Appearance
书源 JSON 结构
Readori 书源使用 JSON。输入可以是单个对象、对象数组或可识别 wrapper;导出时保留 书源身份、规则、请求、登录、分组和启用状态。
顶层字段
| 字段 | 类型 | 作用 |
|---|---|---|
bookSourceUrl | String | 来源唯一身份;导入导出原样保留 |
bookSourceName | String | 显示名称 |
bookSourceGroup | String? | 逗号/分号分组 |
bookSourceType | Int | 0 文本、1 音频、2 图片、3 网络文件 |
enabled/enabledExplore | Bool | 搜索/发现开关 |
header | String? | JSON 或 header lines,可包含规则 JS |
loginUrl/loginUi/loginCheckJs | String? | 登录和来源设置 |
enabledCookieJar | Bool? | null/缺失按兼容默认处理 |
concurrentRate | String? | 来源级请求间隔/窗口限速 |
jsLib | String? | 注入规则 JS 的共享库 |
searchUrl/exploreUrl | String? | 搜索/发现入口 |
ruleSearch/ruleExplore | Object? | 列表规则 |
ruleBookInfo | Object? | 详情规则 |
ruleToc | Object? | 目录规则 |
ruleContent | Object? | 正文规则 |
ruleReview | Object? | 段评模型;运行闭环尚未完成 |
bookSourceUrl 即使含 ## 标签也必须保留。effectiveBaseUrl 仅用于请求相对地址、镜像或 清洗,不用于导入去重、Cookie key、限速或导出。
最小示例
json
{
"bookSourceUrl": "https://example.com/",
"bookSourceName": "Example",
"bookSourceType": 0,
"enabled": true,
"enabledExplore": false,
"searchUrl": "/search?q={{key}}",
"ruleSearch": {
"bookList": ".book",
"name": ".title@text",
"author": ".author@text",
"bookUrl": ".title@href"
},
"ruleBookInfo": {
"name": "h1@text",
"author": ".author@text",
"intro": ".intro@text",
"tocUrl": ".chapters@href"
},
"ruleToc": {
"chapterList": ".chapter-list a",
"chapterName": "@text",
"chapterUrl": "@href"
},
"ruleContent": {
"content": "#content@html"
}
}规则实际语法以 Readori RuleParser/RuleEvaluator 和兼容 fixture 为准。社区源常使用 CSS、 XPath、JSONPath、正则、@js:、<js>、组合、回退和 URL options。
导入/导出
导入接受部分字段的字符串/数值/布尔容错;导出不会包含本地验证 customTag。未知或扩展 本地诊断字段不能被误写成公开书源字段。
