pull/37/head
kunfei 5 years ago
parent 357bc48453
commit d359655a1c
  1. 2
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt
  2. 6
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt

@ -534,7 +534,7 @@ class AnalyzeRule(private var book: BaseBook? = null) {
*/
fun ajax(urlStr: String): String? {
return try {
val analyzeUrl = AnalyzeUrl(urlStr, null, null, null, null, null)
val analyzeUrl = AnalyzeUrl(urlStr, null, null, null, baseUrl, book)
val call = analyzeUrl.getResponse()
val response = call.execute()
response.body()

@ -7,7 +7,7 @@ import io.legado.app.constant.AppConst.SCRIPT_ENGINE
import io.legado.app.constant.Pattern.EXP_PATTERN
import io.legado.app.data.api.IHttpGetApi
import io.legado.app.data.api.IHttpPostApi
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BaseBook
import io.legado.app.help.http.HttpHelper
import io.legado.app.utils.*
import kotlinx.coroutines.Deferred
@ -35,7 +35,7 @@ class AnalyzeUrl(
page: Int? = null,
headerMapF: Map<String, String>? = null,
baseUrl: String? = null,
book: Book? = null
book: BaseBook? = null
) {
companion object {
private val pagePattern = Pattern.compile("<(.*?)>")
@ -80,7 +80,7 @@ class AnalyzeUrl(
/**
* 替换关键字,页数,JS
*/
private fun replaceKeyPageJs(key: String?, page: Int?, book: Book?) {
private fun replaceKeyPageJs(key: String?, page: Int?, book: BaseBook?) {
//page
page?.let {
val matcher = pagePattern.matcher(ruleUrl)

Loading…
Cancel
Save