Skip to content

Commit

Permalink
修复CG中文搜索时返回不相关结果的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
luckiestone committed Oct 15, 2022
1 parent 6bd3e33 commit 6dc4d18
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion resource/sites/cinemageddon.net/getSearchResult.js
@@ -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 6dc4d18

Please sign in to comment.