diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index b1dce05fa..b408f1a86 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -28,9 +28,9 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { var book: BaseBook? = null var chapter: BookChapter? = null var nextChapterUrl: String? = null - private var content: Any? = null - private var baseUrl: String? = null - private var redirectUrl: URL? = null + var content: Any? = null + var baseUrl: String? = null + var redirectUrl: URL? = null private var isJSON: Boolean = false private var isRegex: Boolean = false diff --git a/app/src/main/java/io/legado/app/model/webBook/BookList.kt b/app/src/main/java/io/legado/app/model/webBook/BookList.kt index c486c6e98..68182a693 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookList.kt @@ -168,6 +168,13 @@ object BookList { Debug.log(bookSource.bookSourceUrl, "┌获取封面链接") searchBook.coverUrl = analyzeRule.getString(coverUrl, true) Debug.log(bookSource.bookSourceUrl, "└${searchBook.coverUrl}") + Debug.log(bookSource.bookSourceUrl, "┌获取目录链接") + searchBook.tocUrl = analyzeRule.getString(tocUrl, true) + if (searchBook.tocUrl.isEmpty()) searchBook.tocUrl = baseUrl + if (searchBook.tocUrl == baseUrl) { + searchBook.tocHtml = analyzeRule.content.toString() + } + Debug.log(bookSource.bookSourceUrl, "└${searchBook.tocUrl}") return searchBook } }