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