mirror of
https://github.com/gedoor/legado.git
synced 2024-07-17 00:58:29 +08:00
优化
This commit is contained in:
parent
834effdf1f
commit
57b0e0bbb9
@ -92,7 +92,8 @@ object BookContent {
|
||||
res.body?.let { nextBody ->
|
||||
contentData = analyzeContent(
|
||||
book, nextUrl, res.url, nextBody, contentRule,
|
||||
bookChapter, bookSource, mNextChapterUrl, false
|
||||
bookChapter, bookSource, mNextChapterUrl,
|
||||
printLog = false
|
||||
)
|
||||
nextUrl =
|
||||
if (contentData.second.isNotEmpty()) contentData.second[0] else ""
|
||||
@ -118,7 +119,9 @@ object BookContent {
|
||||
).getStrResponseAwait() //控制并发访问
|
||||
analyzeContent(
|
||||
book, urlStr, res.url, res.body!!, contentRule,
|
||||
bookChapter, bookSource, mNextChapterUrl, false
|
||||
bookChapter, bookSource, mNextChapterUrl,
|
||||
getNextChapterUrl = false,
|
||||
printLog = false
|
||||
).first
|
||||
}
|
||||
}
|
||||
@ -157,6 +160,7 @@ object BookContent {
|
||||
chapter: BookChapter,
|
||||
bookSource: BookSource,
|
||||
nextChapterUrl: String?,
|
||||
getNextChapterUrl: Boolean = true,
|
||||
printLog: Boolean = true
|
||||
): Pair<String, List<String>> {
|
||||
val analyzeRule = AnalyzeRule(book, bookSource)
|
||||
@ -170,7 +174,7 @@ object BookContent {
|
||||
content = HtmlFormatter.formatKeepImg(content, rUrl)
|
||||
//获取下一页链接
|
||||
val nextUrlRule = contentRule.nextContentUrl
|
||||
if (!nextUrlRule.isNullOrEmpty()) {
|
||||
if (getNextChapterUrl && !nextUrlRule.isNullOrEmpty()) {
|
||||
Debug.log(bookSource.bookSourceUrl, "┌获取正文下一页链接", printLog)
|
||||
analyzeRule.getStringList(nextUrlRule, isUrl = true)?.let {
|
||||
nextUrlList.addAll(it)
|
||||
|
Loading…
Reference in New Issue
Block a user