|
|
@ -57,13 +57,13 @@ object WebBook { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return BookList.analyzeBookList( |
|
|
|
return BookList.analyzeBookList( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
variableBook, |
|
|
|
variableBook = variableBook, |
|
|
|
analyzeUrl, |
|
|
|
analyzeUrl = analyzeUrl, |
|
|
|
res.url, |
|
|
|
baseUrl = res.url, |
|
|
|
res.body, |
|
|
|
body = res.body, |
|
|
|
true |
|
|
|
isSearch = true |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
return arrayListOf() |
|
|
|
return arrayListOf() |
|
|
@ -107,13 +107,13 @@ object WebBook { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return BookList.analyzeBookList( |
|
|
|
return BookList.analyzeBookList( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
variableBook, |
|
|
|
variableBook = variableBook, |
|
|
|
analyzeUrl, |
|
|
|
analyzeUrl = analyzeUrl, |
|
|
|
res.url, |
|
|
|
baseUrl = res.url, |
|
|
|
res.body, |
|
|
|
body = res.body, |
|
|
|
false |
|
|
|
isSearch = false |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -141,13 +141,13 @@ object WebBook { |
|
|
|
book.type = bookSource.bookSourceType |
|
|
|
book.type = bookSource.bookSourceType |
|
|
|
if (!book.infoHtml.isNullOrEmpty()) { |
|
|
|
if (!book.infoHtml.isNullOrEmpty()) { |
|
|
|
BookInfo.analyzeBookInfo( |
|
|
|
BookInfo.analyzeBookInfo( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
book, |
|
|
|
book = book, |
|
|
|
book.bookUrl, |
|
|
|
redirectUrl = book.bookUrl, |
|
|
|
book.bookUrl, |
|
|
|
baseUrl = book.bookUrl, |
|
|
|
book.infoHtml, |
|
|
|
body = book.infoHtml, |
|
|
|
canReName |
|
|
|
canReName = canReName |
|
|
|
) |
|
|
|
) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
@ -165,13 +165,13 @@ object WebBook { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
BookInfo.analyzeBookInfo( |
|
|
|
BookInfo.analyzeBookInfo( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
book, |
|
|
|
book = book, |
|
|
|
book.bookUrl, |
|
|
|
redirectUrl = book.bookUrl, |
|
|
|
res.url, |
|
|
|
baseUrl = res.url, |
|
|
|
res.body, |
|
|
|
body = res.body, |
|
|
|
canReName |
|
|
|
canReName = canReName |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
return book |
|
|
|
return book |
|
|
@ -199,12 +199,12 @@ object WebBook { |
|
|
|
book.type = bookSource.bookSourceType |
|
|
|
book.type = bookSource.bookSourceType |
|
|
|
return if (book.bookUrl == book.tocUrl && !book.tocHtml.isNullOrEmpty()) { |
|
|
|
return if (book.bookUrl == book.tocUrl && !book.tocHtml.isNullOrEmpty()) { |
|
|
|
BookChapterList.analyzeChapterList( |
|
|
|
BookChapterList.analyzeChapterList( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
book, |
|
|
|
book = book, |
|
|
|
book.tocUrl, |
|
|
|
redirectUrl = book.tocUrl, |
|
|
|
book.tocUrl, |
|
|
|
baseUrl = book.tocUrl, |
|
|
|
book.tocHtml |
|
|
|
body = book.tocHtml |
|
|
|
) |
|
|
|
) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
@ -222,12 +222,12 @@ object WebBook { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
BookChapterList.analyzeChapterList( |
|
|
|
BookChapterList.analyzeChapterList( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
book, |
|
|
|
book = book, |
|
|
|
book.tocUrl, |
|
|
|
redirectUrl = book.tocUrl, |
|
|
|
res.url, |
|
|
|
baseUrl = res.url, |
|
|
|
res.body |
|
|
|
body = res.body |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -241,10 +241,11 @@ object WebBook { |
|
|
|
book: Book, |
|
|
|
book: Book, |
|
|
|
bookChapter: BookChapter, |
|
|
|
bookChapter: BookChapter, |
|
|
|
nextChapterUrl: String? = null, |
|
|
|
nextChapterUrl: String? = null, |
|
|
|
|
|
|
|
needSave: Boolean = true, |
|
|
|
context: CoroutineContext = Dispatchers.IO |
|
|
|
context: CoroutineContext = Dispatchers.IO |
|
|
|
): Coroutine<String> { |
|
|
|
): Coroutine<String> { |
|
|
|
return Coroutine.async(scope, context) { |
|
|
|
return Coroutine.async(scope, context) { |
|
|
|
getContentAwait(scope, bookSource, book, bookChapter, nextChapterUrl) |
|
|
|
getContentAwait(scope, bookSource, book, bookChapter, nextChapterUrl, needSave) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -253,7 +254,8 @@ object WebBook { |
|
|
|
bookSource: BookSource, |
|
|
|
bookSource: BookSource, |
|
|
|
book: Book, |
|
|
|
book: Book, |
|
|
|
bookChapter: BookChapter, |
|
|
|
bookChapter: BookChapter, |
|
|
|
nextChapterUrl: String? = null |
|
|
|
nextChapterUrl: String? = null, |
|
|
|
|
|
|
|
needSave: Boolean = true |
|
|
|
): String { |
|
|
|
): String { |
|
|
|
if (bookSource.getContentRule().content.isNullOrEmpty()) { |
|
|
|
if (bookSource.getContentRule().content.isNullOrEmpty()) { |
|
|
|
Debug.log(bookSource.bookSourceUrl, "⇒正文规则为空,使用章节链接:${bookChapter.url}") |
|
|
|
Debug.log(bookSource.bookSourceUrl, "⇒正文规则为空,使用章节链接:${bookChapter.url}") |
|
|
@ -261,14 +263,15 @@ object WebBook { |
|
|
|
} |
|
|
|
} |
|
|
|
return if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) { |
|
|
|
return if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) { |
|
|
|
BookContent.analyzeContent( |
|
|
|
BookContent.analyzeContent( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
book, |
|
|
|
book = book, |
|
|
|
bookChapter, |
|
|
|
bookChapter = bookChapter, |
|
|
|
bookChapter.getAbsoluteURL(), |
|
|
|
redirectUrl = bookChapter.getAbsoluteURL(), |
|
|
|
bookChapter.getAbsoluteURL(), |
|
|
|
baseUrl = bookChapter.getAbsoluteURL(), |
|
|
|
book.tocHtml, |
|
|
|
body = book.tocHtml, |
|
|
|
nextChapterUrl |
|
|
|
nextChapterUrl = nextChapterUrl, |
|
|
|
|
|
|
|
needSave = needSave |
|
|
|
) |
|
|
|
) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
|
val analyzeUrl = AnalyzeUrl( |
|
|
@ -290,14 +293,15 @@ object WebBook { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
BookContent.analyzeContent( |
|
|
|
BookContent.analyzeContent( |
|
|
|
scope, |
|
|
|
scope = scope, |
|
|
|
bookSource, |
|
|
|
bookSource = bookSource, |
|
|
|
book, |
|
|
|
book = book, |
|
|
|
bookChapter, |
|
|
|
bookChapter = bookChapter, |
|
|
|
bookChapter.getAbsoluteURL(), |
|
|
|
redirectUrl = bookChapter.getAbsoluteURL(), |
|
|
|
res.url, |
|
|
|
baseUrl = res.url, |
|
|
|
res.body, |
|
|
|
body = res.body, |
|
|
|
nextChapterUrl |
|
|
|
nextChapterUrl = nextChapterUrl, |
|
|
|
|
|
|
|
needSave = needSave |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|