Giter Club home page Giter Club logo

Comments (8)

Rhilip avatar Rhilip commented on August 23, 2024

这个暂时帮不了Orz。。。。
我没这个站的号。。

这个问题一般出在 https://github.com/Rhilip/PT-help/blob/master/docs/js/ptsearch.user.js#L183 这里,对时间进行提取的时候没能得到正确的结果。
请尝试切换时间类型看看能否解决。

from pt-help.

 avatar commented on August 23, 2024

666 我之前自己试过切换时间类型,然而没生效。。你说了之后我重新登录了下,就好了,建议提醒使用者。。切换后需要重新登录生效

from pt-help.

Rhilip avatar Rhilip commented on August 23, 2024

喵,按理说切换时间类型是实时生效的(。・∀・)ノ
不应该需要重新登陆。(当然以这个站的模板,可能我不是很清楚他具体改成什么样子了
我这边脚本会优先以已去时间(x时x分)的形式进行解析,如果解析不成功的话,才会以发生时间匹配,因为这样最符合站点默认设定。但因为之前使用了一种很奇怪的正则进行匹配,所以在以发生时间进行匹配就容易解析出错。
我等过段时间看下这个东西怎么处理好吧。先open在这吧,省的到时候忘记了

from pt-help.

 avatar commented on August 23, 2024

完。。现在切换成已去时间也不好使了。。错误提示一样。
嗯,我有没有办法可以提供给你 网站模板 之类的,供你参考呢。
总之有空再搞嘛<( ̄3 ̄)>

from pt-help.

Rhilip avatar Rhilip commented on August 23, 2024

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.

 avatar commented on August 23, 2024

辛苦,感谢修复。。以下为最新测试结果。

  1. 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;

  1. TTG搜索好像炸了... 请验证 手动捂脸

from pt-help.

Rhilip avatar Rhilip commented on August 23, 2024

这是feature (╯‵□′)╯︵┻━┻

  1. 因为用的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;
+                }
  1. 嗯,TTG的修好了(●ˇ∀ˇ●)。 昨天版本改了时间匹配的正则,结果忘了测试其他使用那个正则的网站了。

commit: 574361c

from pt-help.

 avatar commented on August 23, 2024

好吧都ok了。。刚才可能没刷新

from pt-help.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.