|
|
@ -65,16 +65,16 @@ object BookChapterList { |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
).getResponseAwait(bookSource.bookSourceUrl) |
|
|
|
).getResponseAwait(bookSource.bookSourceUrl) |
|
|
|
.body?.let { nextBody -> |
|
|
|
.body?.let { nextBody -> |
|
|
|
chapterData = analyzeChapterList( |
|
|
|
chapterData = analyzeChapterList( |
|
|
|
book, nextUrl, nextBody, tocRule, listRule, bookSource |
|
|
|
book, nextUrl, nextBody, tocRule, listRule, bookSource |
|
|
|
) |
|
|
|
) |
|
|
|
nextUrl = if (chapterData.nextUrl.isNotEmpty()) { |
|
|
|
nextUrl = if (chapterData.nextUrl.isNotEmpty()) { |
|
|
|
chapterData.nextUrl[0] |
|
|
|
chapterData.nextUrl[0] |
|
|
|
} else "" |
|
|
|
} else "" |
|
|
|
chapterData.chapterList?.let { |
|
|
|
chapterData.chapterList?.let { |
|
|
|
chapterList.addAll(it) |
|
|
|
chapterList.addAll(it) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
Debug.log(bookSource.bookSourceUrl, "◇目录总页数:${nextUrlList.size}") |
|
|
|
Debug.log(bookSource.bookSourceUrl, "◇目录总页数:${nextUrlList.size}") |
|
|
|
block.resume(finish(book, chapterList, reverse)) |
|
|
|
block.resume(finish(book, chapterList, reverse)) |
|
|
@ -241,13 +241,15 @@ object BookChapterList { |
|
|
|
var isVip: String? |
|
|
|
var isVip: String? |
|
|
|
for (item in elements) { |
|
|
|
for (item in elements) { |
|
|
|
analyzeRule.setContent(item) |
|
|
|
analyzeRule.setContent(item) |
|
|
|
val bookChapter = BookChapter(bookUrl = book.bookUrl) |
|
|
|
val bookChapter = BookChapter(bookUrl = book.bookUrl, baseUrl = baseUrl) |
|
|
|
analyzeRule.chapter = bookChapter |
|
|
|
analyzeRule.chapter = bookChapter |
|
|
|
bookChapter.title = analyzeRule.getString(nameRule) |
|
|
|
bookChapter.title = analyzeRule.getString(nameRule) |
|
|
|
bookChapter.url = analyzeRule.getString(urlRule) |
|
|
|
bookChapter.url = analyzeRule.getString(urlRule) |
|
|
|
bookChapter.tag = analyzeRule.getString(update) |
|
|
|
bookChapter.tag = analyzeRule.getString(update) |
|
|
|
isVip = analyzeRule.getString(vipRule) |
|
|
|
isVip = analyzeRule.getString(vipRule) |
|
|
|
if (bookChapter.url.isEmpty()) bookChapter.url = baseUrl |
|
|
|
if (bookChapter.url.isEmpty()) { |
|
|
|
|
|
|
|
bookChapter.url = baseUrl |
|
|
|
|
|
|
|
} |
|
|
|
if (bookChapter.title.isNotEmpty()) { |
|
|
|
if (bookChapter.title.isNotEmpty()) { |
|
|
|
if (isVip.isNotEmpty() && isVip != "null" && isVip != "false" && isVip != "0") { |
|
|
|
if (isVip.isNotEmpty() && isVip != "null" && isVip != "false" && isVip != "0") { |
|
|
|
bookChapter.title = "\uD83D\uDD12" + bookChapter.title |
|
|
|
bookChapter.title = "\uD83D\uDD12" + bookChapter.title |
|
|
@ -257,7 +259,7 @@ object BookChapterList { |
|
|
|
} |
|
|
|
} |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└${chapterList[0].title}", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└${chapterList[0].title}", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "┌获取首章链接", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "┌获取首章链接", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└${chapterList[0].url}", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└${chapterList[0].getAbsoluteURL()}", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "┌获取首章信息", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "┌获取首章信息", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└${chapterList[0].tag}", log) |
|
|
|
Debug.log(bookSource.bookSourceUrl, "└${chapterList[0].tag}", log) |
|
|
|
} |
|
|
|
} |
|
|
|