gedoor / legado

Legado 3.0 Book Reader with powerful controls & full functions❤️阅读3.0, 阅读是一款可以自定义来源阅读网络内容的工具,为广大网络文学爱好者提供一种方便、快捷舒适的试读体验。
GNU General Public License v3.0
29.12k stars 3.86k forks source link

下载规则不触发 #4290

Closed ladia closed 1 day ago

ladia commented 3 days ago

确认 / Assignments

问题描述 / Describe Bugs

书源里添加了下载链接,但是似乎并不能获取到填入的下载链接,还是会读取目录,然后目录获取失败,想知道是写源码写的有问题吗

复现步骤 / How to reproduce

{ "bookSourceComment": "", "bookSourceGroup": "", "bookSourceName": "爱去txt论坛", "bookSourceType": 0, "bookSourceUrl": "http://www.527txt.shop/list.html", "bookUrlPattern": "", "customOrder": -2, "enabled": true, "enabledCookieJar": false, "enabledExplore": true, "exploreUrl": "[{\"title\":\"推荐\",\"url\":\"/list-high-0-{{page}}.html\",\"style\":{\"layout_flexBasisPercent\":1}},{\"title\":\"🌸言情\",\"url\":\"/list-1-{{page}}.html\",\"style\":{\"layout_flexBasisPercent\":1}},{\"title\":\"穿越重生\",\"url\":\"/list-1-{{page}}.html?label=穿越重生\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"都市校园\",\"url\":\"/list-1-{{page}}.html?label=都市校园\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"玄幻架空\",\"url\":\"/list-1-{{page}}.html?label=玄幻架空\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"古装言情\",\"url\":\"/list-1-{{page}}.html?label=古装言情\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"现代都市\",\"url\":\"/list-1-{{page}}.html?label=现代都市\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"灵异玄幻\",\"url\":\"/list-1-{{page}}.html?label=灵异玄幻\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"仙侠魔幻\",\"url\":\"/list-1-{{page}}.html?label=仙侠魔幻\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"网游竞技\",\"url\":\"/list-1-{{page}}.html?label=网游竞技\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"bg同人\",\"url\":\"/list-1-{{page}}.html?label=BG同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"🌱耽美\",\"url\":\"/list-2-{{page}}.html\",\"style\":{\"layout_flexBasisPercent\":1}},{\"title\":\"灵异玄幻\",\"url\":\"/list-2-{{page}}.html?label=灵异玄幻\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"现代都市\",\"url\":\"/list-2-{{page}}.html?label=现代都市\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"古装迷情\",\"url\":\"/list-2-{{page}}.html?label=古装迷情\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"穿越重生\",\"url\":\"/list-2-{{page}}.html?label=穿越重生\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"网游竞技\",\"url\":\"/list-2-{{page}}.html?label=网游竞技\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"蕾丝百合\",\"url\":\"/list-2-{{page}}.html?label=蕾丝百合\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"综漫同人\",\"url\":\"/list-2-{{page}}.html?label=综漫同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"影视同人\",\"url\":\"/list-2-{{page}}.html?label=影视同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"动漫同人\",\"url\":\"/list-2-{{page}}.html?label=动漫同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"小说同人\",\"url\":\"/list-2-{{page}}.html?label=小说同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"HP同人\",\"url\":\"/list-2-{{page}}.html?label=HP同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"历史同人\",\"url\":\"/list-2-{{page}}.html?label=历史同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.25}},{\"title\":\"真人同人\",\"url\":\"/list-2-{{page}}.html?label=真人同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.4}},{\"title\":\"其他同人\",\"url\":\"/list-2-{{page}}.html?label=其他同人\",\"style\":{\"layout_flexGrow\":1,\"layout_flexBasisPercent\":0.4}}]", "lastUpdateTime": 1729268094289, "respondTime": 180000, "ruleBookInfo": { "author": ".pk-text-center.0@text##.作者:|【\w完.|.by", "canReName": "1", "downloadUrls": "", "intro": ".readcontent@p:not(:has(a))@html##《.?》txt全集 作者:.?【\w完结.?】[  ](?:文案[::  ])?[  ]|《.?》txt全集 作者:.?(?=(?:晋江|长佩|豆腐|起点)VIP|七猫中文网)[  ](?:文案[::  ])?[  ]|  文案:?  |爱去小说网(www.\w+\.\w+)全力打造最方便的TXT电子书下载网|本书为言情小说站result=result.replace(/[BB]/g,\"b\").replace(/G/g,\"g\").replace(/L/g,\"l\").replace(/CP/g,\"cp\")", "kind": "", "name": ".pk-text-center.0@text##《|》.", "tocUrl": "a=\"http://www.527txt.shop/\"+java.getString(\"@@.readcontent@a@href\");\ndoc=java.ajax(a);\nu=doc.match(/downloadurl = \"([^\"])/)[1];\nurl=\"http://www.527txt.shop/\"+String(u);\n" }, "ruleContent": { "content": "", "replaceRegex": "##推荐一个小说下载必备网址:www.\w+.com\r\n每天更新,喜欢的去看看。" }, "ruleExplore": {}, "ruleReview": {}, "ruleSearch": { "author": ".rt@text##.作者:|【\w完.|.by", "bookList": ".read-list!0", "bookUrl": ".rt@a@href", "intro": "tag.div.8@text##《.?》txt全集 作者:.?【\w完结.?】[  ](?:文案[::  ])?[  ]|《.?》txt全集 作者:.?(?=(?:晋江|长佩|豆腐|起点)VIP|七猫中文网)[  ](?:文案[::  ])?[  ]|  文案:?  |爱去小说网(www.\w+\.\w+)全力打造最方便的TXT电子书下载网站|本书为言情小说\nresult=result.replace(/[BB]/g,\"b\").replace(/G/g,\"g\").replace(/L/g,\"l\").replace(/CP/g,\"cp\")", "kind": "{{@@a.2@text}},{{@@div.5@text}},{{@@span.-1@text}},{{@@font@color}}\nresult=result.replace(/.FF0000/gi,\"荐\").replace(/[BB]/g,\"b\").replace(/G/g,\"g\").replace(/L/g,\"l\").replace(/CP/g,\"cp\").replace(/小说|专区|\u0023000000|.0000FF/g,\"\")", "name": ".rt@text##《|》." }, "ruleToc": { "chapterList": "", "chapterName": "", "chapterUrl": "" }, "weight": 0 } 是书源,测试下载链接填的a="http://www.527txt.shop/"+java.getString("@@.readcontent@a@href"); doc=java.ajax(a); u=doc.match(/downloadurl = "([^"])/)[1]; url="http://www.527txt.shop/"+String(u); 因为调试源时不显示下载url也没法判断获取到的是什么值,把这一段放到目录url规则调试http://www.527txt.shop/read-69784-1.html 目录填html时看目录页源码是可以正常加载出下载的全文的,但是把这段放入下载url,在发现里点进去看书阅读就会弹目录列表为空

确认 / Assignment

其他信息 / Additions

No response

日志提交 / Relevant log output

No response

阅读版本 / Legado version

3.24101521

Android版本 / Android version

14

机型 / Model

小米13

821938089 commented 2 days ago

书源类型需要是文件

ladia commented 1 day ago

书源类型需要是文件

改完确实好了 就是在选择下载在线文件时 Screenshot_2024-10-20-20-20-06-722_io legado play releaseA-edit 这里可以在书源里实现规范化命名吗

821938089 commented 1 day ago

不能