pull/464/head
gedoor 4 years ago
parent dab5add93a
commit 35ab379d19
  1. 58
      app/src/main/java/io/legado/app/model/webBook/WebBook.kt

@ -179,31 +179,37 @@ class WebBook(val bookSource: BookSource) {
Debug.log(sourceUrl, "⇒正文规则为空,使用章节链接:${bookChapter.url}") Debug.log(sourceUrl, "⇒正文规则为空,使用章节链接:${bookChapter.url}")
return bookChapter.url return bookChapter.url
} }
val body = return if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) {
if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) { BookContent.analyzeContent(
book.tocHtml scope,
} else { book.tocHtml,
val analyzeUrl = AnalyzeUrl( book,
ruleUrl = bookChapter.getAbsoluteURL(), bookChapter,
baseUrl = book.tocUrl, bookSource,
headerMapF = bookSource.getHeaderMap(), bookChapter.getAbsoluteURL(),
book = book, nextChapterUrl
chapter = bookChapter )
) } else {
analyzeUrl.getResponseAwait( val res = AnalyzeUrl(
bookSource.bookSourceUrl, ruleUrl = bookChapter.getAbsoluteURL(),
jsStr = bookSource.getContentRule().webJs, baseUrl = book.tocUrl,
sourceRegex = bookSource.getContentRule().sourceRegex headerMapF = bookSource.getHeaderMap(),
).body book = book,
} chapter = bookChapter
return BookContent.analyzeContent( ).getResponseAwait(
scope, bookSource.bookSourceUrl,
body, jsStr = bookSource.getContentRule().webJs,
book, sourceRegex = bookSource.getContentRule().sourceRegex
bookChapter, )
bookSource, BookContent.analyzeContent(
bookChapter.url, scope,
nextChapterUrl res.body,
) book,
bookChapter,
bookSource,
res.url,
nextChapterUrl
)
}
} }
} }
Loading…
Cancel
Save