|
|
@ -86,16 +86,20 @@ class WebBook(val bookSource: BookSource) { |
|
|
|
context: CoroutineContext = Dispatchers.IO |
|
|
|
context: CoroutineContext = Dispatchers.IO |
|
|
|
): Coroutine<Book> { |
|
|
|
): Coroutine<Book> { |
|
|
|
return Coroutine.async(scope, context) { |
|
|
|
return Coroutine.async(scope, context) { |
|
|
|
val body = if (book.infoHtml.isNullOrEmpty()) { |
|
|
|
val body = if (!book.infoHtml.isNullOrEmpty()) { |
|
|
|
|
|
|
|
book.infoHtml |
|
|
|
|
|
|
|
} else { |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
|
book = book, |
|
|
|
book = book, |
|
|
|
ruleUrl = book.bookUrl, |
|
|
|
ruleUrl = book.bookUrl, |
|
|
|
baseUrl = sourceUrl, |
|
|
|
baseUrl = sourceUrl, |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
) |
|
|
|
) |
|
|
|
analyzeUrl.getResponseAwait().body() |
|
|
|
if (analyzeUrl.useWebView()) { |
|
|
|
|
|
|
|
analyzeUrl.getResultByWebView(bookSource.bookSourceUrl) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
book.infoHtml |
|
|
|
analyzeUrl.getResponseAwait().body() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
BookInfo.analyzeBookInfo(book, body, bookSource, book.bookUrl) |
|
|
|
BookInfo.analyzeBookInfo(book, body, bookSource, book.bookUrl) |
|
|
|
book |
|
|
|
book |
|
|
@ -120,8 +124,12 @@ class WebBook(val bookSource: BookSource) { |
|
|
|
baseUrl = book.bookUrl, |
|
|
|
baseUrl = book.bookUrl, |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
if (analyzeUrl.useWebView()) { |
|
|
|
|
|
|
|
analyzeUrl.getResultByWebView(bookSource.bookSourceUrl) |
|
|
|
|
|
|
|
} else { |
|
|
|
analyzeUrl.getResponseAwait().body() |
|
|
|
analyzeUrl.getResponseAwait().body() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
BookChapterList.analyzeChapterList(this, book, body, bookSource, book.tocUrl) |
|
|
|
BookChapterList.analyzeChapterList(this, book, body, bookSource, book.tocUrl) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -150,8 +158,12 @@ class WebBook(val bookSource: BookSource) { |
|
|
|
baseUrl = book.tocUrl, |
|
|
|
baseUrl = book.tocUrl, |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
if (analyzeUrl.useWebView()) { |
|
|
|
|
|
|
|
analyzeUrl.getResultByWebView(bookSource.bookSourceUrl) |
|
|
|
|
|
|
|
} else { |
|
|
|
analyzeUrl.getResponseAwait().body() |
|
|
|
analyzeUrl.getResponseAwait().body() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
BookContent.analyzeContent( |
|
|
|
BookContent.analyzeContent( |
|
|
|
this, |
|
|
|
this, |
|
|
|
body, |
|
|
|
body, |
|
|
|