diff --git a/app/src/main/java/io/legado/app/model/WebBook.kt b/app/src/main/java/io/legado/app/model/WebBook.kt index 6e00a80bc..a09e9f326 100644 --- a/app/src/main/java/io/legado/app/model/WebBook.kt +++ b/app/src/main/java/io/legado/app/model/WebBook.kt @@ -114,6 +114,7 @@ class WebBook(val bookSource: BookSource) { book, bookChapter, bookSource, + analyzeUrl, nextChapterUrl ) } diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 080345ab1..654882cc2 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -30,7 +30,7 @@ import javax.script.SimpleBindings @Keep @SuppressLint("DefaultLocale") class AnalyzeUrl( - private var ruleUrl: String, + var ruleUrl: String, key: String? = null, page: Int? = null, headerMapF: Map? = null, diff --git a/app/src/main/java/io/legado/app/model/webbook/BookChapterList.kt b/app/src/main/java/io/legado/app/model/webbook/BookChapterList.kt index 3557ea844..13c4ab54b 100644 --- a/app/src/main/java/io/legado/app/model/webbook/BookChapterList.kt +++ b/app/src/main/java/io/legado/app/model/webbook/BookChapterList.kt @@ -26,8 +26,13 @@ object BookChapterList { var chapterList = arrayListOf() val baseUrl: String = NetworkUtils.getUrl(response) val body: String? = response.body() - body ?: throw Exception(App.INSTANCE.getString(R.string.error_get_web_content, baseUrl)) - SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl") + body ?: throw Exception( + App.INSTANCE.getString( + R.string.error_get_web_content, + analyzeUrl.ruleUrl + ) + ) + SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}") val tocRule = bookSource.getTocRule() val nextUrlList = arrayListOf(baseUrl) var reverse = false diff --git a/app/src/main/java/io/legado/app/model/webbook/BookContent.kt b/app/src/main/java/io/legado/app/model/webbook/BookContent.kt index 0f78b9d4a..fc5178104 100644 --- a/app/src/main/java/io/legado/app/model/webbook/BookContent.kt +++ b/app/src/main/java/io/legado/app/model/webbook/BookContent.kt @@ -23,6 +23,7 @@ object BookContent { book: Book, bookChapter: BookChapter, bookSource: BookSource, + analyzeUrl: AnalyzeUrl, nextChapterUrlF: String? = null ): String { val baseUrl: String = NetworkUtils.getUrl(response) @@ -30,10 +31,10 @@ object BookContent { body ?: throw Exception( App.INSTANCE.getString( R.string.error_get_web_content, - baseUrl + analyzeUrl.ruleUrl ) ) - SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl") + SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}") val content = StringBuilder() val nextUrlList = arrayListOf(baseUrl) val contentRule = bookSource.getContentRule() diff --git a/app/src/main/java/io/legado/app/model/webbook/BookInfo.kt b/app/src/main/java/io/legado/app/model/webbook/BookInfo.kt index 1a7c5051c..c80ce8c55 100644 --- a/app/src/main/java/io/legado/app/model/webbook/BookInfo.kt +++ b/app/src/main/java/io/legado/app/model/webbook/BookInfo.kt @@ -21,10 +21,10 @@ object BookInfo { body ?: throw Exception( App.INSTANCE.getString( R.string.error_get_web_content, - baseUrl + analyzeUrl.ruleUrl ) ) - SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl") + SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}") val infoRule = bookSource.getBookInfoRule() val analyzeRule = AnalyzeRule(book) analyzeRule.setContent(body, baseUrl) 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 1e2bfb6c9..8d953c342 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 @@ -25,10 +25,10 @@ object BookList { body ?: throw Exception( App.INSTANCE.getString( R.string.error_get_web_content, - baseUrl + analyzeUrl.ruleUrl ) ) - SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl") + SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}") val analyzeRule = AnalyzeRule(null) analyzeRule.setContent(body, baseUrl) bookSource.bookUrlPattern?.let {