Merge remote-tracking branch 'origin/master'

pull/1705/head
kunfei 3 years ago
commit 72a34942d2
  1. 2
      app/src/main/assets/help/SourceMBookHelp.md
  2. 4
      app/src/main/assets/web/bookSource/index.html
  3. 2
      app/src/main/assets/web/bookshelf/css/detail.6c59ead7.css
  4. 4
      app/src/main/assets/web/bookshelf/index.html
  5. 0
      app/src/main/assets/web/bookshelf/js/about.15db9edd.js
  6. 2
      app/src/main/assets/web/bookshelf/js/app.577d13d7.js
  7. 2
      app/src/main/assets/web/bookshelf/js/detail.7345620e.js
  8. 2
      app/src/main/assets/web/rssSource/index.html
  9. 2
      app/src/main/java/io/legado/app/constant/BookType.kt
  10. 2
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  11. 10
      app/src/main/java/io/legado/app/service/CheckSourceService.kt

@ -24,6 +24,6 @@
* 校验所选
* 校验书源可批量校验书源,由于网络等原因结果仅限参考
* "校验成功"是指所选的校验项目全部通过
* 可正常识别搜索为空、发现为空、搜索(发现)目录为空、搜索(发现)正文为空、校验超时导致的失效,其余原因(网站异常、源码变动)导致的视为规则失效
* 可正常识别搜索为空、发现为空、搜索(发现)目录为空、搜索(发现)正文为空、校验超时、js执行错误导致的失效,其余的原因视为网站失效
* 校验搜索优先使用书源填写的校验关键词,不存在时使用用户输入的关键词
* 校验结束后会自动筛选"失效"书源

@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<title>阅读3.0源编辑器_V4.0</title>
<link rel="icon" href="favicon.ico">
<link rel="icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="index.css"/>
</head>
@ -25,7 +25,7 @@
<div>
<div>源类型 :</div>
<textarea rows="1" id="bookSourceType" class="base" title="bookSourceType"
placeholder="&lt;必填&gt;0:文本 1:音频 3:图片"></textarea>
placeholder="&lt;必填&gt;0:文本 1:音频 2:图片"></textarea>
</div>
<div>
<div>源名称 :</div>

@ -1,3 +1,3 @@
<!DOCTYPE html><html lang="en" style="padding: 0;height:100%"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="../favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"><title>Legado Bookshelf</title><link href="css/about.54684f5f.css" rel="prefetch"><link href="css/detail.c8b66cd9.css" rel="prefetch"><link href="js/about.a06cf811.js" rel="prefetch"><link href="js/detail.76141273.js" rel="prefetch"><link href="css/app.e4c919b7.css" rel="preload" as="style"><link href="css/chunk-vendors.5f0f4fba.css" rel="preload" as="style"><link href="js/app.4f313f0a.js" rel="preload" as="script"><link href="js/chunk-vendors.be6090cd.js" rel="preload" as="script"><link href="css/chunk-vendors.5f0f4fba.css" rel="stylesheet"><link href="css/app.e4c919b7.css" rel="stylesheet"></head><style>body::-webkit-scrollbar {
<!DOCTYPE html><html lang="en" style="padding: 0;height:100%"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="../favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"><title>Legado Bookshelf</title><link href="css/about.54684f5f.css" rel="prefetch"><link href="css/detail.6c59ead7.css" rel="prefetch"><link href="js/about.15db9edd.js" rel="prefetch"><link href="js/detail.7345620e.js" rel="prefetch"><link href="css/app.e4c919b7.css" rel="preload" as="style"><link href="css/chunk-vendors.5f0f4fba.css" rel="preload" as="style"><link href="js/app.577d13d7.js" rel="preload" as="script"><link href="js/chunk-vendors.be6090cd.js" rel="preload" as="script"><link href="css/chunk-vendors.5f0f4fba.css" rel="stylesheet"><link href="css/app.e4c919b7.css" rel="stylesheet"></head><style>body::-webkit-scrollbar {
display: none;
}</style><body style="margin: 0;height:100%"><noscript><strong>We're sorry but yd-web-tool doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.be6090cd.js"></script><script src="js/app.4f313f0a.js"></script></body></html>
}</style><body style="margin: 0;height:100%"><noscript><strong>We're sorry but yd-web-tool doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.be6090cd.js"></script><script src="js/app.577d13d7.js"></script></body></html>

@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<title>阅读3.0订阅源编辑器_V4.0</title>
<link rel="icon" href="favicon.ico">
<link rel="icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="index.css"/>
</head>

@ -5,7 +5,7 @@ import androidx.annotation.IntDef
object BookType {
const val default = 0 // 0 文本
const val audio = 1 // 1 音频
const val image = 3 //图片
const val image = 2 //图片
const val local = "loc_book"
@Target(AnnotationTarget.VALUE_PARAMETER)

@ -26,7 +26,7 @@ data class BookSource(
var bookSourceName: String = "",
// 分组
var bookSourceGroup: String? = null,
// 类型,0 文本,1 音频, 3 图片
// 类型,0 文本,1 音频, 2 图片
@BookType.Type
var bookSourceType: Int = 0,
// 详情页url正则

@ -24,6 +24,8 @@ import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.launch
import java.util.concurrent.Executors
import kotlin.math.min
import org.mozilla.javascript.WrappedException
import javax.script.ScriptException
/**
* 校验书源
@ -176,18 +178,15 @@ class CheckSourceService : BaseService() {
}.timeout(CheckSource.timeout)
.onError(searchCoroutine) {
when(it) {
//校验超时不能正常实现 不能识别
is TimeoutCancellationException -> source.addGroup("校验超时")
//NoStackTraceException 已经添加了分组,其余的视为规则失效
!is NoStackTraceException -> source.addGroup("规则失效")
is ScriptException, is WrappedException -> source.addGroup("js失效")
!is NoStackTraceException -> source.addGroup("网站失效")
}
source.bookSourceComment =
"Error: ${it.localizedMessage}" + if (source.bookSourceComment.isNullOrBlank())
"" else "\n\n${source.bookSourceComment}"
Debug.updateFinalMessage(source.bookSourceUrl, "校验失败:${it.localizedMessage}")
}.onSuccess(searchCoroutine) {
source.removeGroup("失效")
source.removeGroup("规则失效")
source.removeGroup("校验超时")
Debug.updateFinalMessage(source.bookSourceUrl, "校验成功")
}.onFinally(IO) {
@ -230,7 +229,6 @@ class CheckSourceService : BaseService() {
when (it) {
is ContentEmptyException -> source.addGroup("${bookType}正文失效")
is TocEmptyException -> source.addGroup("${bookType}目录失效")
//超时 网站异常 源码改变
else -> throw it
}
}.onSuccess {

Loading…
Cancel
Save