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

Loading…
Cancel
Save