-
Notifications
You must be signed in to change notification settings - Fork 26
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有没有考虑过支持阅读APP的书源? #8
Comments
JAVA代码的规则兼容不好实现 |
阅读的书源规则似乎也是JSONPath,XPath那些( https://mgz0227.github.io/The-tutorial-of-Legado/Rule/source.html ) @aooiuu |
工作量还是有点大。 |
用的人多不多不是问题,问题是实际能用书源够不够多。 |
不,这不是一回事,阅读要移植其它平台,安卓原生开发没法跨平台,ios那些平台不用java,所以,移植得重写所有东西,linux或win能用java,但ui又不通用,所以至少ui相关都要重写。如果它一开始用的是compose或flutter,移植就会容易很多。 |
耦合度太高,没法支持它的特性,他没有标准规范,阅读2的规则支持度高一些。你多看看书源写法,很多符号含义不一样,甚至很多版本更新只为了某个书源写法,它的解码方法多到凌乱,相互重复可以替代的方法很多。或许你认为的支持就是不包含js方法部分,我是觉得没有那些js方法,支持也没意义,如果支持js方法,那就不是阅读的事情了,在js里对http请求和编码解码,和同步异步问题,这个any-reader是原生支持js特性的,他直接用es规范的fetch异步来做,这是正常而合理的。我觉得js部分存在根本的矛盾,所以不支持。至于很多app所谓支持阅读都是虚有其表,支持度如果量化,很多不到50%,最后是只用现在的功能完善已经有几千个源可用。 举例的xpath写法和jsonpath写法在any-reader本来就支持,那是有规范的。不必担心这一点。 仍可商榷。作者保重身体,加油更,期待。 |
jsonpath和xpath部分any-reader已然支持,我以为问题不在此处。 |
大佬,就等你先支持了 然后我来抄下作业 |
我是指这个书源根本不可能搞定(觉得有什么误会 <js>
loadDocType="{{@@body@data-doctype}}";
loadType="{{@@body@data-randomtype}}";
sid=baseUrl.match(/(\d+).html/)[1];
url=baseUrl.replace(/\d+.html/,'')
var section = {
loadDocType: loadDocType,
loadType: loadType,
sid:sid,
content: {
childNode: [],
init: function(c){
this.body=c
if (section.loadType == 'normal') {
this.load(String(java.base64Decode(java.getString('//*[@name="client"]/@content'))))
} else if (section.loadType == 'substep') {
var d = 'r' + section.sid;
var f = false;
if (section.loadDocType == 'xml') {
d += '.xml'
} else if (section.loadDocType == 'json') {
d += '.json';
f = true
} else {
return false
};
cookie="PHPSESSID="+java.get(baseUrl,{}).cookie("PHPSESSID");
token= java.get(url+d,{"X-Requested-With": "XMLHttpRequest","referer":baseUrl,"cookie":String(cookie)}).header("token")
this.load(token)
} else {
return false
};
},
load: function(a) {
a = String(java.base64Decode(a)).split(/[A-Z]+%/);
var b = 0,
start = 0;
for (var i = 0; i < this.body.length; i++) {
if (String(this.body[i]).match(/h2/i)) {
start = i + 1
};
if (String(this.body[i]).match(/div/i)&& this.body[i].attr("class") != 'chapter') {
break
}
};
for (var i = 0; i < a.length; i++) {
if (a[i] < 5) {
this.childNode[a[i]] = this.body[i + start];
b++
} else {
this.childNode[a[i] - b] = this.body[i + start]
}
};
}
}
}
section.content.init(java.getElement("@@id.content@children!0").toArray());
section.content.childNode.join("")
</js>
tag.div@ownText |
感觉可以注入JS, 去实现一些JAVA方法 比如注入JS var java = {}
java.base64Decode = () => {} // JS模拟具体实现 即使这样,工作量依旧巨大。 |
自然可以,这是类似于『环境模拟』,比如常见的模拟『webview环境』,增加一个window对象 |
阅读3解析库分支: https://github.com/aooiuu/any-reader/tree/legado 不定期开发。 感兴趣的可以一起参与开发。 |
这个书源还是有可能搞定的,只不过会很麻烦: |
阅读规则中的json可能是不标准的格式,用这个库应该可以修复 |
这个不错,感觉可以在后面导入规则时用这个库转换成标准json |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
https://github.com/gedoor/legado
感觉还是阅读用的人更多吧(实际上我也不知道)
The text was updated successfully, but these errors were encountered: