mirror of
https://github.com/Aminark/legado-ios.git
synced 2026-10-24 12:51:22 +08:00
feat: open-source 小浣熊阅读 for iOS
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# 规则测试样本
|
||||
|
||||
这些文件是自动化测试输入,不是 App 的内置书源库。测试包通过 SwiftPM 单独复制该目录,App 目标不会打包它。
|
||||
|
||||
- `synthetic-html-rules.json`:最小 HTML 规则,使用保留域名 `fixture.invalid`,验证倒序目录、裸字段提取和带章节变量的内容净化。网络响应在测试中自造,不访问真实网站。
|
||||
- `legado-js-audio-source.json`:脱敏 JS 听书规则结构样本。地址使用 `fixture.invalid`,用于测试导入字段及脚本保留,不在常规导入测试中请求网络或执行脚本。
|
||||
|
||||
新增样本优先自造数据;第三方材料须保留版权与许可。不要把账号凭据或真实付费内容放入 fixture。
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"bookSourceUrl": "https://fixture.invalid",
|
||||
"bookSourceName": "脱敏 JS 听书源",
|
||||
"bookSourceGroup": "兼容夹具",
|
||||
"bookSourceType": 1,
|
||||
"enabled": true,
|
||||
"enabledExplore": true,
|
||||
"searchUrl": "https://fixture.invalid/search,{\"method\":\"POST\",\"body\":{\"title\":\"searchKey\",\"page\":{{searchPage}}}}",
|
||||
"ruleSearch": {
|
||||
"bookList": "$.content.content",
|
||||
"name": "$.title",
|
||||
"author": "$.author",
|
||||
"bookUrl": "$.id@js:java.put('bookId', result);'/toc?bookId='+result",
|
||||
"coverUrl": "$.cover@js:var cover=JSON.parse(result);'/file/'+cover.path"
|
||||
},
|
||||
"ruleBookInfo": {},
|
||||
"ruleToc": {
|
||||
"chapterList": "$.content.content",
|
||||
"chapterName": "$.chapterTitle",
|
||||
"chapterUrl": "$.id@js:java.put('chapterId', result);'/audio?bookId='+java.get('bookId')+'&chapterId='+result"
|
||||
},
|
||||
"ruleContent": {
|
||||
"content": "@js:result"
|
||||
},
|
||||
"ruleReview": {
|
||||
"reviewUrl": "/review/{{chapterId}}",
|
||||
"contentRule": "$.content",
|
||||
"postTimeRule": "$.time"
|
||||
},
|
||||
"eventListener": false,
|
||||
"customButton": false
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"bookSourceName": "合成 HTML 规则",
|
||||
"bookSourceUrl": "https://fixture.invalid",
|
||||
"ruleToc": {
|
||||
"chapterList": "id.chapter-list.0@tag.a[-1:0]",
|
||||
"chapterName": "text",
|
||||
"chapterUrl": "href"
|
||||
},
|
||||
"ruleContent": {
|
||||
"content": "class.chapter-body@html",
|
||||
"replaceRegex": "##(?m)^(?:第一章|信息|{{book.durChapterTitle}}|\\(本章完\\))\\s*$"
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user