|
|
@ -43,7 +43,7 @@ object BookList { |
|
|
|
scope.ensureActive() |
|
|
|
scope.ensureActive() |
|
|
|
if (baseUrl.matches(it.toRegex())) { |
|
|
|
if (baseUrl.matches(it.toRegex())) { |
|
|
|
Debug.log(bookSource.bookSourceUrl, "≡链接为详情页") |
|
|
|
Debug.log(bookSource.bookSourceUrl, "≡链接为详情页") |
|
|
|
getInfoItem(scope, analyzeRule, bookSource, baseUrl, variableBook.variable) |
|
|
|
getInfoItem(scope, body, analyzeRule, bookSource, baseUrl, variableBook.variable) |
|
|
|
?.let { searchBook -> |
|
|
|
?.let { searchBook -> |
|
|
|
searchBook.infoHtml = body |
|
|
|
searchBook.infoHtml = body |
|
|
|
bookList.add(searchBook) |
|
|
|
bookList.add(searchBook) |
|
|
@ -71,7 +71,7 @@ object BookList { |
|
|
|
scope.ensureActive() |
|
|
|
scope.ensureActive() |
|
|
|
if (collections.isEmpty() && bookSource.bookUrlPattern.isNullOrEmpty()) { |
|
|
|
if (collections.isEmpty() && bookSource.bookUrlPattern.isNullOrEmpty()) { |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└列表为空,按详情页解析") |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└列表为空,按详情页解析") |
|
|
|
getInfoItem(scope, analyzeRule, bookSource, baseUrl, variableBook.variable) |
|
|
|
getInfoItem(scope, body, analyzeRule, bookSource, baseUrl, variableBook.variable) |
|
|
|
?.let { searchBook -> |
|
|
|
?.let { searchBook -> |
|
|
|
searchBook.infoHtml = body |
|
|
|
searchBook.infoHtml = body |
|
|
|
bookList.add(searchBook) |
|
|
|
bookList.add(searchBook) |
|
|
@ -120,6 +120,7 @@ object BookList { |
|
|
|
@Throws(Exception::class) |
|
|
|
@Throws(Exception::class) |
|
|
|
private fun getInfoItem( |
|
|
|
private fun getInfoItem( |
|
|
|
scope: CoroutineScope, |
|
|
|
scope: CoroutineScope, |
|
|
|
|
|
|
|
body: String, |
|
|
|
analyzeRule: AnalyzeRule, |
|
|
|
analyzeRule: AnalyzeRule, |
|
|
|
bookSource: BookSource, |
|
|
|
bookSource: BookSource, |
|
|
|
baseUrl: String, |
|
|
|
baseUrl: String, |
|
|
@ -132,7 +133,16 @@ object BookList { |
|
|
|
book.originOrder = bookSource.customOrder |
|
|
|
book.originOrder = bookSource.customOrder |
|
|
|
book.type = bookSource.bookSourceType |
|
|
|
book.type = bookSource.bookSourceType |
|
|
|
analyzeRule.book = book |
|
|
|
analyzeRule.book = book |
|
|
|
BookInfo.analyzeBookInfo(scope, book, analyzeRule, bookSource, baseUrl, baseUrl, false) |
|
|
|
BookInfo.analyzeBookInfo( |
|
|
|
|
|
|
|
scope, |
|
|
|
|
|
|
|
book, |
|
|
|
|
|
|
|
body, |
|
|
|
|
|
|
|
analyzeRule, |
|
|
|
|
|
|
|
bookSource, |
|
|
|
|
|
|
|
baseUrl, |
|
|
|
|
|
|
|
baseUrl, |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
) |
|
|
|
if (book.name.isNotBlank()) { |
|
|
|
if (book.name.isNotBlank()) { |
|
|
|
return book.toSearchBook() |
|
|
|
return book.toSearchBook() |
|
|
|
} |
|
|
|
} |
|
|
|