feat:添加文件类下载链接规则

pull/1882/head
Xwite 3 years ago
parent a65d234325
commit b44e0e76fe
  1. 2
      app/src/main/assets/help/ruleHelp.md
  2. 3
      app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt

@ -11,7 +11,7 @@
: regex规则,不可省略,只可以用在书籍列表和目录列表
```
* 书源类型: 文件
> 对于类似知轩藏书提供文件整合下载的网站,可以'在书源详情的目录URL规则获取文件链接,阅读会自动下载并导入
> 对于类似知轩藏书提供文件整合下载的网站,可以'在书源详情的下载URL规则获取文件链接,支持多个链接,阅读会自动下载并导入
* CookieJar
> 启用后会自动保存每次返回头中的Set-Cookie中的值,适用于验证码图片一类需要session的网站

@ -16,5 +16,6 @@ data class BookInfoRule(
var coverUrl: String? = null,
var tocUrl: String? = null,
var wordCount: String? = null,
var canReName: String? = null
var canReName: String? = null,
var downloadUrls: String? = null
) : Parcelable

@ -266,6 +266,7 @@ class BookSourceEditActivity :
add(EditEntity("coverUrl", ir?.coverUrl, R.string.rule_cover_url))
add(EditEntity("tocUrl", ir?.tocUrl, R.string.rule_toc_url))
add(EditEntity("canReName", ir?.canReName, R.string.rule_can_re_name))
add(EditEntity("downloadUrls", ir?.downloadUrls, R.string.download_url_rule))
}
//目录页
val tr = source?.getTocRule()
@ -396,6 +397,7 @@ class BookSourceEditActivity :
"tocUrl" -> bookInfoRule.tocUrl =
viewModel.ruleComplete(it.value, bookInfoRule.init, 2)
"canReName" -> bookInfoRule.canReName = it.value
"downloadUrls" -> bookInfoRule.downloadUrls = viewModel.ruleComplete(it.value, bookInfoRule.init)
}
}
tocEntities.forEach {

Loading…
Cancel
Save