Skip to content

Commit

Permalink
Merge pull request pt-plugins#1141 from luckiestone/dev
Browse files Browse the repository at this point in the history
修复CG中文搜索时返回不相关结果的bug
  • Loading branch information
ted423 authored Oct 16, 2022
2 parents 99ab2de + 6dc4d18 commit 9af1753
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion resource/sites/cinemageddon.net/getSearchResult.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
if (!"".getQueryString) {
String.prototype.getQueryString = function(name, split) {
if (split == undefined) split = "&";
var reg = new RegExp(
"(^|" + split + "|\\?)" + name + "=([^" + split + "]*)(" + split + "|$)"
),
r;
if ((r = this.match(reg))) return decodeURI(r[2]);
return null;
};
}

(function(options) {
class Parser {
constructor() {
Expand Down Expand Up @@ -26,7 +38,10 @@
let results = [];
// 获取种子列表行
let rows = options.page.find(options.resultSelector);
if (rows.length == 0) {
const browsecheck = options.page
.find("a[href*='browse.php?page']:contains('-'):last")
.attr("href");
if (rows.length == 0 || browsecheck) {
options.status = ESearchResultParseStatus.torrentTableIsEmpty; //`[${options.site.name}]没有定位到种子列表,或没有相关的种子`;
return results;
}
Expand Down

0 comments on commit 9af1753

Please sign in to comment.