pull/465/head
gedoor 4 years ago
parent e3c8145028
commit 65004e33a5
  1. 16
      app/src/main/java/io/legado/app/model/webBook/WebBook.kt

@ -101,19 +101,18 @@ class WebBook(val bookSource: BookSource) {
): Coroutine<Book> {
return Coroutine.async(scope, context) {
book.type = bookSource.bookSourceType
val body =
if (!book.infoHtml.isNullOrEmpty()) {
book.infoHtml
BookInfo.analyzeBookInfo(book, book.infoHtml, bookSource, book.bookUrl, canReName)
} else {
val analyzeUrl = AnalyzeUrl(
val res = AnalyzeUrl(
ruleUrl = book.bookUrl,
baseUrl = sourceUrl,
headerMapF = bookSource.getHeaderMap(),
book = book
)
analyzeUrl.getResponseAwait(bookSource.bookSourceUrl).body
).getResponseAwait(bookSource.bookSourceUrl)
BookInfo.analyzeBookInfo(book, res.body, bookSource, res.url, canReName)
}
BookInfo.analyzeBookInfo(book, body, bookSource, book.bookUrl, canReName)
book
}
}
@ -143,7 +142,12 @@ class WebBook(val bookSource: BookSource) {
baseUrl = book.bookUrl,
headerMapF = bookSource.getHeaderMap()
).getResponseAwait(bookSource.bookSourceUrl)
BookChapterList.analyzeChapterList(this, book, res.body, bookSource, res.url)
BookChapterList.analyzeChapterList(
this,
book, res.body,
bookSource,
res.url
)
}
}

Loading…
Cancel
Save