Merge pull request #2158 from Xwite/master

'fix(AnalyzeUrl): skip analyze when mUrl is DataURL'
pull/2160/head
kunfei 2 years ago committed by GitHub
commit 0a5ca5cf88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/src/main/assets/help/ruleHelp.md
  2. 18
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt

@ -153,4 +153,4 @@ let options = {
* 购买操作
> 返回购买链接,可直接填写链接或者JavaScript
> 可用变量 book chapter
> 可用变量 book chapter java(不支持AnalyzeRule函数) source

@ -72,18 +72,16 @@ class AnalyzeUrl(
private val enabledCookieJar = source?.enabledCookieJar ?: false
init {
if (!mUrl.isDataUrl()) {
val urlMatcher = paramPattern.matcher(baseUrl)
if (urlMatcher.find()) baseUrl = baseUrl.substring(0, urlMatcher.start())
(headerMapF ?: source?.getHeaderMap(true))?.let {
headerMap.putAll(it)
if (it.containsKey("proxy")) {
proxy = it["proxy"]
headerMap.remove("proxy")
}
val urlMatcher = paramPattern.matcher(baseUrl)
if (urlMatcher.find()) baseUrl = baseUrl.substring(0, urlMatcher.start())
(headerMapF ?: source?.getHeaderMap(true))?.let {
headerMap.putAll(it)
if (it.containsKey("proxy")) {
proxy = it["proxy"]
headerMap.remove("proxy")
}
initUrl()
}
initUrl()
}
/**

Loading…
Cancel
Save