|
|
@ -35,7 +35,7 @@ object BookContent { |
|
|
|
val content = StringBuilder() |
|
|
|
val content = StringBuilder() |
|
|
|
val nextUrlList = arrayListOf(baseUrl) |
|
|
|
val nextUrlList = arrayListOf(baseUrl) |
|
|
|
val contentRule = bookSource.getContentRule() |
|
|
|
val contentRule = bookSource.getContentRule() |
|
|
|
var contentData = analyzeContent(body, contentRule, book, bookSource, baseUrl) |
|
|
|
var contentData = analyzeContent(body, contentRule, book, bookChapter, bookSource, baseUrl) |
|
|
|
content.append(contentData.content) |
|
|
|
content.append(contentData.content) |
|
|
|
if (contentData.nextUrl.size == 1) { |
|
|
|
if (contentData.nextUrl.size == 1) { |
|
|
|
var nextUrl = contentData.nextUrl[0] |
|
|
|
var nextUrl = contentData.nextUrl[0] |
|
|
@ -56,7 +56,15 @@ object BookContent { |
|
|
|
).getResponseAwait() |
|
|
|
).getResponseAwait() |
|
|
|
.body()?.let { nextBody -> |
|
|
|
.body()?.let { nextBody -> |
|
|
|
contentData = |
|
|
|
contentData = |
|
|
|
analyzeContent(nextBody, contentRule, book, bookSource, baseUrl, false) |
|
|
|
analyzeContent( |
|
|
|
|
|
|
|
nextBody, |
|
|
|
|
|
|
|
contentRule, |
|
|
|
|
|
|
|
book, |
|
|
|
|
|
|
|
bookChapter, |
|
|
|
|
|
|
|
bookSource, |
|
|
|
|
|
|
|
baseUrl, |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
) |
|
|
|
nextUrl = |
|
|
|
nextUrl = |
|
|
|
if (contentData.nextUrl.isNotEmpty()) contentData.nextUrl[0] else "" |
|
|
|
if (contentData.nextUrl.isNotEmpty()) contentData.nextUrl[0] else "" |
|
|
|
content.append(contentData.content) |
|
|
|
content.append(contentData.content) |
|
|
@ -82,6 +90,7 @@ object BookContent { |
|
|
|
it, |
|
|
|
it, |
|
|
|
contentRule, |
|
|
|
contentRule, |
|
|
|
book, |
|
|
|
book, |
|
|
|
|
|
|
|
bookChapter, |
|
|
|
bookSource, |
|
|
|
bookSource, |
|
|
|
item.nextUrl, |
|
|
|
item.nextUrl, |
|
|
|
false |
|
|
|
false |
|
|
@ -106,6 +115,7 @@ object BookContent { |
|
|
|
body: String, |
|
|
|
body: String, |
|
|
|
contentRule: ContentRule, |
|
|
|
contentRule: ContentRule, |
|
|
|
book: Book, |
|
|
|
book: Book, |
|
|
|
|
|
|
|
chapter: BookChapter, |
|
|
|
bookSource: BookSource, |
|
|
|
bookSource: BookSource, |
|
|
|
baseUrl: String, |
|
|
|
baseUrl: String, |
|
|
|
printLog: Boolean = true |
|
|
|
printLog: Boolean = true |
|
|
@ -113,6 +123,7 @@ object BookContent { |
|
|
|
val nextUrlList = arrayListOf<String>() |
|
|
|
val nextUrlList = arrayListOf<String>() |
|
|
|
val analyzeRule = AnalyzeRule(book) |
|
|
|
val analyzeRule = AnalyzeRule(book) |
|
|
|
analyzeRule.setContent(body, baseUrl) |
|
|
|
analyzeRule.setContent(body, baseUrl) |
|
|
|
|
|
|
|
analyzeRule.chapter = chapter |
|
|
|
val nextUrlRule = contentRule.nextContentUrl |
|
|
|
val nextUrlRule = contentRule.nextContentUrl |
|
|
|
if (!nextUrlRule.isNullOrEmpty()) { |
|
|
|
if (!nextUrlRule.isNullOrEmpty()) { |
|
|
|
SourceDebug.printLog(bookSource.bookSourceUrl, "┌获取正文下一页链接", printLog) |
|
|
|
SourceDebug.printLog(bookSource.bookSourceUrl, "┌获取正文下一页链接", printLog) |
|
|
|