Comments (8)
这个暂时帮不了Orz。。。。
我没这个站的号。。
这个问题一般出在 https://github.com/Rhilip/PT-help/blob/master/docs/js/ptsearch.user.js#L183 这里,对时间进行提取的时候没能得到正确的结果。
请尝试切换时间类型看看能否解决。
from pt-help.
666 我之前自己试过切换时间类型,然而没生效。。你说了之后我重新登录了下,就好了,建议提醒使用者。。切换后需要重新登录生效
from pt-help.
喵,按理说切换时间类型是实时生效的(。・∀・)ノ
不应该需要重新登陆。(当然以这个站的模板,可能我不是很清楚他具体改成什么样子了
我这边脚本会优先以已去时间(x时x分)的形式进行解析,如果解析不成功的话,才会以发生时间匹配,因为这样最符合站点默认设定。但因为之前使用了一种很奇怪的正则进行匹配,所以在以发生时间进行匹配就容易解析出错。
我等过段时间看下这个东西怎么处理好吧。先open在这吧,省的到时候忘记了
from pt-help.
完。。现在切换成已去时间也不好使了。。错误提示一样。
嗯,我有没有办法可以提供给你 网站模板 之类的,供你参考呢。
总之有空再搞嘛<( ̄3 ̄)>
from pt-help.
在 834853c#diff-79e541e322c2d7d3306fdf16551cecfbR136 中,我尝试更换了时间dom的匹配方式。
以下为相关代码的实现
// 确定日期tag,因用户在站点设置中配置及站点优惠信息的情况的存在,此处dom结构会有不同
// 此外多数站点对于 seeders, leechers, completed 没有额外的定位信息,故要依赖于正确的日期tag
- var _tag_date, _date;
- _tag_date = torrent_data_raw.find((site === "U2") ? "time" : "span").filter(function () {
- return time_regex.test($(this).attr("title"));
- }).last().parent("td");
- if (/[分时天月年]/.test(_tag_date.text())) {
- _date = _tag_date.children((site === "U2") ? "time" : "span").attr("title");
- } else {
- _tag_date = torrent_data_raw.find("td").filter(function () {
- return time_regex.test($(this).text());
- }).last();
- _date = _tag_date.text().match(time_regex)[1].replace(/-(\d{2}) ?(\d{2}):/, "-$1 $2:");
+ var _tag_date, _date = "0000-00-00 00:00:00";
+ _tag_date = torrent_data_raw.find("> td").filter(function () {
+ return /(\d{4}-\d{2}-\d{2}[^\d]+?\d{2}:\d{2}:\d{2})|[分时天月年]/.test($(this).html());
+ }).last();
+ if (_tag_date && _tag_date.html()) {
+ _date = (_tag_date.html().match(time_regex) || ["", "0000-00-00 00:00:00"])[1].replace(/-(\d{2})[^\d]+?(\d{2}):/, "-$1 $2:");
我希望这样更改能使这个问题解决Orz
(希望这个站的dom结构没有改成葡萄那样。。
请更新脚本到 20180326
尝试搜索,希望你能继续反馈结果。如果已经解决,请直接Close issue
from pt-help.
辛苦,感谢修复。。以下为最新测试结果。
- Hyperay
搜索有结果的关键词时,一切正常,不管网站如何设置;
如果搜索结果为空(比如搜"事实上")。。则有很神奇的结果:
每次都是这几个。。
; link: https://www.hyperay.org/undefined; pubdate: NaN; size: 添加者; seeders: 0; leechers: 0; completed: 0;
The Pirate 1973 1080p BluRay DD 2.0 x264-Tron; link: https://www.hyperay.org/advance_notice.php?id=2151&advance_notice_details=1&hit=1; pubdate: 1521983854000; size: 匿名; seeders: 0; leechers: 0; completed: 0;
The Pirate 1973 720p BluRay DD 2.0 x264-Tron; link: https://www.hyperay.org/advance_notice.php?id=2150&advance_notice_details=1&hit=1; pubdate: 1521983489000; size: 匿名; seeders: 0; leechers: 0; completed: 0;
Django 2017 BluRay 1080p AVC DTS-HD MA5.1-Hyper; link: https://www.hyperay.org/advance_notice.php?id=2147&advance_notice_details=1&hit=1; pubdate: 1521732933000; size: 匿名; seeders: 0; leechers: 0; completed: 0;
Paddington.2.2017.720p.BluRay.DD.5.1.x264-Tron; link: https://www.hyperay.org/advance_notice.php?id=2146&advance_notice_details=1&hit=1; pubdate: 1521639675000; size: 匿名; seeders: 0; leechers: 0; completed: 0;
Paddington.2.2017.1080p.BluRay.DTS.x264-Tron; link: https://www.hyperay.org/advance_notice.php?id=2145&advance_notice_details=1&hit=1; pubdate: 1521639663000; size: 匿名; seeders: 0; leechers: 0; completed: 0;
- TTG搜索好像炸了... 请验证 手动捂脸
from pt-help.
这是feature (╯‵□′)╯︵┻━┻
- 因为用的css选择器是
"table.torrents:last > tbody > tr:gt(0)"
,这个站的预告栏也加了torrents的class,所以在无真实种子的情况下,原预告栏的种子就被抓下来了。。暂时先用了个前置的判断来解决吧。希望这个简单的判断不会影响到真正的搜索,比如搜索没有种子
这种情况 ( ̄y▽, ̄)╭
(我本来这个table.torrents:last
就是为这个站准备的。。其他站只需要table.torrents
就行了。。。。结果没想到还有这种情况Orz
+ if (/没有种子|用准确的关键字重试/.test(res.responseText)) {
+ writelog("No any torrent find in Site " + site + ".");
+ return;
+ }
- 嗯,TTG的修好了(●ˇ∀ˇ●)。 昨天版本改了时间匹配的正则,结果忘了测试其他使用那个正则的网站了。
commit: 574361c
from pt-help.
好吧都ok了。。刚才可能没刷新
from pt-help.
Related Issues (20)
- 种子名称后缀有数字 HOT 5
- 好多路搜索出错 HOT 1
- hdcity无法搜索 HOT 2
- ptgen输入电影名点击查询后未生成电影信息 HOT 4
- 很好用,特意过来说声谢谢
- An error occurred when searching in Site
- 部署后端,出现 Internal error HOT 9
- Deploy ptsearch on vps issue? HOT 4
- 你好 求新闻联播的1080p资源 HOT 1
- 搜索设置勾选站点保存后过一段时间会复原…… HOT 1
- ptgen搜索空白 HOT 1
- 无法生成Bangumi简介,返回Internal error : None HOT 1
- MT换网址 HOT 1
- shabang 中文叹号 HOT 1
- Cannot read property 'split' of undefined
- 脚本突然完全失效 HOT 1
- HDU/OpenCD无法搜索 HOT 4
- 你好,请问下pt-search 不能选择CCF? HOT 4
- 一个关于MT二次验证的问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pt-help.