pull/1352/head
gedoor 3 years ago
parent e3e7756e39
commit 7cade2b051
  1. 3
      app/src/main/java/io/legado/app/help/JsExtensions.kt
  2. 1
      app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt

@ -45,6 +45,7 @@ interface JsExtensions {
val analyzeUrl = AnalyzeUrl(urlStr, source = getSource()) val analyzeUrl = AnalyzeUrl(urlStr, source = getSource())
analyzeUrl.getStrResponse().body analyzeUrl.getStrResponse().body
}.onFailure { }.onFailure {
log("ajax(${urlStr}) error\n${it.stackTraceToString()}")
it.printOnDebug() it.printOnDebug()
}.getOrElse { }.getOrElse {
it.msg it.msg
@ -80,6 +81,7 @@ interface JsExtensions {
kotlin.runCatching { kotlin.runCatching {
analyzeUrl.getStrResponse() analyzeUrl.getStrResponse()
}.onFailure { }.onFailure {
log("connect(${urlStr}) error\n${it.stackTraceToString()}")
it.printOnDebug() it.printOnDebug()
}.getOrElse { }.getOrElse {
StrResponse(analyzeUrl.url, it.localizedMessage) StrResponse(analyzeUrl.url, it.localizedMessage)
@ -94,6 +96,7 @@ interface JsExtensions {
kotlin.runCatching { kotlin.runCatching {
analyzeUrl.getStrResponse() analyzeUrl.getStrResponse()
}.onFailure { }.onFailure {
log("ajax($urlStr,$header) error\n${it.stackTraceToString()}")
it.printOnDebug() it.printOnDebug()
}.getOrElse { }.getOrElse {
StrResponse(analyzeUrl.url, it.localizedMessage) StrResponse(analyzeUrl.url, it.localizedMessage)

@ -191,6 +191,7 @@ object BookChapterList {
isPay = analyzeRule.getString(payRule) isPay = analyzeRule.getString(payRule)
if (bookChapter.url.isEmpty()) { if (bookChapter.url.isEmpty()) {
bookChapter.url = baseUrl bookChapter.url = baseUrl
Debug.log(bookSource.bookSourceUrl, "未获取到url,使用baseUrl替代")
} }
if (bookChapter.title.isNotEmpty()) { if (bookChapter.title.isNotEmpty()) {
if (isVip.isNotEmpty() && !isVip.matches(falseRegex)) { if (isVip.isNotEmpty() && !isVip.matches(falseRegex)) {

Loading…
Cancel
Save