|
|
@ -47,15 +47,8 @@ object BookChapterList { |
|
|
|
} |
|
|
|
} |
|
|
|
var chapterData = |
|
|
|
var chapterData = |
|
|
|
analyzeChapterList( |
|
|
|
analyzeChapterList( |
|
|
|
scope, |
|
|
|
scope, book, baseUrl, redirectUrl, body, |
|
|
|
book, |
|
|
|
tocRule, listRule, bookSource, log = true |
|
|
|
baseUrl, |
|
|
|
|
|
|
|
redirectUrl, |
|
|
|
|
|
|
|
body, |
|
|
|
|
|
|
|
tocRule, |
|
|
|
|
|
|
|
listRule, |
|
|
|
|
|
|
|
bookSource, |
|
|
|
|
|
|
|
log = true |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
chapterData.chapterList?.let { |
|
|
|
chapterData.chapterList?.let { |
|
|
|
chapterList.addAll(it) |
|
|
|
chapterList.addAll(it) |
|
|
@ -75,14 +68,8 @@ object BookChapterList { |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
headerMapF = bookSource.getHeaderMap() |
|
|
|
).getStrResponse(bookSource.bookSourceUrl).body?.let { nextBody -> |
|
|
|
).getStrResponse(bookSource.bookSourceUrl).body?.let { nextBody -> |
|
|
|
chapterData = analyzeChapterList( |
|
|
|
chapterData = analyzeChapterList( |
|
|
|
this, |
|
|
|
this, book, nextUrl, nextUrl, |
|
|
|
book, |
|
|
|
nextBody, tocRule, listRule, bookSource |
|
|
|
nextUrl, |
|
|
|
|
|
|
|
nextUrl, |
|
|
|
|
|
|
|
nextBody, |
|
|
|
|
|
|
|
tocRule, |
|
|
|
|
|
|
|
listRule, |
|
|
|
|
|
|
|
bookSource |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
nextUrl = chapterData.nextUrl.firstOrNull() ?: "" |
|
|
|
nextUrl = chapterData.nextUrl.firstOrNull() ?: "" |
|
|
|
chapterData.chapterList?.let { |
|
|
|
chapterData.chapterList?.let { |
|
|
@ -144,15 +131,8 @@ object BookChapterList { |
|
|
|
).getStrResponse(bookSource.bookSourceUrl).body |
|
|
|
).getStrResponse(bookSource.bookSourceUrl).body |
|
|
|
?: throw Exception("${chapterData.nextUrl}, 下载失败") |
|
|
|
?: throw Exception("${chapterData.nextUrl}, 下载失败") |
|
|
|
val nextChapterData = analyzeChapterList( |
|
|
|
val nextChapterData = analyzeChapterList( |
|
|
|
this, |
|
|
|
this, book, chapterData.nextUrl, chapterData.nextUrl, |
|
|
|
book, |
|
|
|
nextBody, tocRule, listRule, bookSource, false |
|
|
|
chapterData.nextUrl, |
|
|
|
|
|
|
|
chapterData.nextUrl, |
|
|
|
|
|
|
|
nextBody, |
|
|
|
|
|
|
|
tocRule, |
|
|
|
|
|
|
|
listRule, |
|
|
|
|
|
|
|
bookSource, |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
synchronized(chapterDataList) { |
|
|
|
synchronized(chapterDataList) { |
|
|
|
val isFinished = addChapterListIsFinish( |
|
|
|
val isFinished = addChapterListIsFinish( |
|
|
|