pull/34/head
kunfei 5 years ago
parent e16cb8df0a
commit 975bd42526
  1. 1
      app/src/main/java/io/legado/app/model/WebBook.kt
  2. 2
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt
  3. 9
      app/src/main/java/io/legado/app/model/webbook/BookChapterList.kt
  4. 5
      app/src/main/java/io/legado/app/model/webbook/BookContent.kt
  5. 4
      app/src/main/java/io/legado/app/model/webbook/BookInfo.kt
  6. 4
      app/src/main/java/io/legado/app/model/webbook/BookList.kt

@ -114,6 +114,7 @@ class WebBook(val bookSource: BookSource) {
book,
bookChapter,
bookSource,
analyzeUrl,
nextChapterUrl
)
}

@ -30,7 +30,7 @@ import javax.script.SimpleBindings
@Keep
@SuppressLint("DefaultLocale")
class AnalyzeUrl(
private var ruleUrl: String,
var ruleUrl: String,
key: String? = null,
page: Int? = null,
headerMapF: Map<String, String>? = null,

@ -26,8 +26,13 @@ object BookChapterList {
var chapterList = arrayListOf<BookChapter>()
val baseUrl: String = NetworkUtils.getUrl(response)
val body: String? = response.body()
body ?: throw Exception(App.INSTANCE.getString(R.string.error_get_web_content, baseUrl))
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl")
body ?: throw Exception(
App.INSTANCE.getString(
R.string.error_get_web_content,
analyzeUrl.ruleUrl
)
)
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}")
val tocRule = bookSource.getTocRule()
val nextUrlList = arrayListOf(baseUrl)
var reverse = false

@ -23,6 +23,7 @@ object BookContent {
book: Book,
bookChapter: BookChapter,
bookSource: BookSource,
analyzeUrl: AnalyzeUrl,
nextChapterUrlF: String? = null
): String {
val baseUrl: String = NetworkUtils.getUrl(response)
@ -30,10 +31,10 @@ object BookContent {
body ?: throw Exception(
App.INSTANCE.getString(
R.string.error_get_web_content,
baseUrl
analyzeUrl.ruleUrl
)
)
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl")
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}")
val content = StringBuilder()
val nextUrlList = arrayListOf(baseUrl)
val contentRule = bookSource.getContentRule()

@ -21,10 +21,10 @@ object BookInfo {
body ?: throw Exception(
App.INSTANCE.getString(
R.string.error_get_web_content,
baseUrl
analyzeUrl.ruleUrl
)
)
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl")
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}")
val infoRule = bookSource.getBookInfoRule()
val analyzeRule = AnalyzeRule(book)
analyzeRule.setContent(body, baseUrl)

@ -25,10 +25,10 @@ object BookList {
body ?: throw Exception(
App.INSTANCE.getString(
R.string.error_get_web_content,
baseUrl
analyzeUrl.ruleUrl
)
)
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:$baseUrl")
SourceDebug.printLog(bookSource.bookSourceUrl, 1, "获取成功:${analyzeUrl.ruleUrl}")
val analyzeRule = AnalyzeRule(null)
analyzeRule.setContent(body, baseUrl)
bookSource.bookUrlPattern?.let {

Loading…
Cancel
Save