Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
Fixes #1274
Fixes #1275
Fixes #1276
  • Loading branch information
qsniyg committed Feb 6, 2024
1 parent bb3e407 commit 7d72ec6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
2024.2.1 (in-dev)

Special thanks to rEnr3n for their contributions and reports for this release
Special thanks to rEnr3n, beeznutsonly for their contributions and reports for this release

---

Expand Down
34 changes: 23 additions & 11 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3379,8 +3379,8 @@ var $$IMU_EXPORT$$;
}
};

function is_element(x) {
if (!x || typeof x !== "object")
function is_element(x:any):boolean {
if (!x || typeof x !== "object" || is_array(x))
return false;

if (("namespaceURI" in x) && ("nodeType" in x) && ("nodeName" in x) && ("childNodes" in x)) {
Expand All @@ -3394,18 +3394,23 @@ var $$IMU_EXPORT$$;

// very slow
if (is_interactive) {
if ((x instanceof Node) ||
(x instanceof Element) ||
(x instanceof HTMLDocument) ||
(x instanceof Window)) {
return true;
let objects = [Node, Element, HTMLDocument, Window];

for (let obj of objects) {
// some websites override Window
try {
if (x instanceof obj)
return true;
} catch (e) {
console_error(e);
}
}
}

return false;
}

function is_iterable_object(x) {
function is_iterable_object(x:any):boolean {
return typeof x === "object" && x !== null && !is_array(x) && !is_element(x);
}

Expand Down Expand Up @@ -24693,7 +24698,6 @@ var $$IMU_EXPORT$$;
console_error(cache_key, "Unable to find items in", resp);
return null;
}

var urls = [];
for (var i = 0; i < match.length; i++) {
var smatch = match[i].match(regex);
Expand All @@ -24703,7 +24707,7 @@ var $$IMU_EXPORT$$;

urls.push({
url: url,
quality: parse_int(quality),
quality: parse_int(quality.replace(/^([0-9]+)p$/, "$1")),
video: true
});
}
Expand Down Expand Up @@ -46576,6 +46580,10 @@ var $$IMU_EXPORT$$;
// https://simp6.jpg.church/images/testfcc38151209151b9.th.jpg
// https://simp6.jpg.church/images/testfcc38151209151b9.jpg
(domain_nosub === "jpg.church" && /^simp[0-9]*\./.test(domain)) ||
// thanks to beeznutsonly on github: https://github.com/qsniyg/maxurl/issues/1274
// https://simp6.host.church/images/testfcc38151209151b9.th.jpg
// https://simp6.host.church/images/testfcc38151209151b9.jpg
(domain_nosub === "host.church" && /^simp[0-9]*\./.test(domain)) ||
// thanks to vscum on github: https://github.com/qsniyg/maxurl/issues/1166
// https://photoloading.com/images/2023/01/28/6475687587.th.jpg
// https://photoloading.com/images/2023/01/28/6475687587.jpg
Expand Down Expand Up @@ -107037,8 +107045,12 @@ var $$IMU_EXPORT$$;
}

if (domain_nosub === "kemono.party" ||
// thanks to beeznutsonly on github: https://github.com/qsniyg/maxurl/issues/1275
domain_nosub === "kemono.su" ||
// thanks to vscum on github: https://github.com/qsniyg/maxurl/pull/1137
domain_nosub === "coomer.party") {
domain_nosub === "coomer.party" ||
// thanks to beeznutsonly on github: https://github.com/qsniyg/maxurl/issues/1276
domain_nosub === "coomer.su") {
// thanks to BrandonKMLee on github: https://github.com/qsniyg/maxurl/issues/1093
// https://kemono.party/thumbnail/data/30/34/3034877e08c6b13c03db53879464858ae4a4f8f2360c7755d16a241a2613e12c.png
// https://data65.kemono.party/data/30/34/3034877e08c6b13c03db53879464858ae4a4f8f2360c7755d16a241a2613e12c.png
Expand Down
29 changes: 21 additions & 8 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,7 @@ var $$IMU_EXPORT$$;
}
};
function is_element(x) {
if (!x || typeof x !== "object")
if (!x || typeof x !== "object" || is_array(x))
return false;
if (("namespaceURI" in x) && ("nodeType" in x) && ("nodeName" in x) && ("childNodes" in x)) {
return true;
Expand All @@ -2693,11 +2693,16 @@ var $$IMU_EXPORT$$;
}
// very slow
if (is_interactive) {
if ((x instanceof Node) ||
(x instanceof Element) ||
(x instanceof HTMLDocument) ||
(x instanceof Window)) {
return true;
var objects = [Node, Element, HTMLDocument, Window];
for (var _i = 0, objects_1 = objects; _i < objects_1.length; _i++) {
var obj = objects_1[_i];
// some websites override Window
try {
if (x instanceof obj)
return true;
} catch (e) {
console_error(e);
}
}
}
return false;
Expand Down Expand Up @@ -22687,7 +22692,7 @@ var $$IMU_EXPORT$$;
var url = decode_entities(smatch[2]);
urls.push({
url: url,
quality: parse_int(quality),
quality: parse_int(quality.replace(/^([0-9]+)p$/, "$1")),
video: true
});
}
Expand Down Expand Up @@ -42514,6 +42519,10 @@ var $$IMU_EXPORT$$;
// https://simp6.jpg.church/images/testfcc38151209151b9.th.jpg
// https://simp6.jpg.church/images/testfcc38151209151b9.jpg
(domain_nosub === "jpg.church" && /^simp[0-9]*\./.test(domain)) ||
// thanks to beeznutsonly on github: https://github.com/qsniyg/maxurl/issues/1274
// https://simp6.host.church/images/testfcc38151209151b9.th.jpg
// https://simp6.host.church/images/testfcc38151209151b9.jpg
(domain_nosub === "host.church" && /^simp[0-9]*\./.test(domain)) ||
// thanks to vscum on github: https://github.com/qsniyg/maxurl/issues/1166
// https://photoloading.com/images/2023/01/28/6475687587.th.jpg
// https://photoloading.com/images/2023/01/28/6475687587.jpg
Expand Down Expand Up @@ -96077,8 +96086,12 @@ var $$IMU_EXPORT$$;
}
}
if (domain_nosub === "kemono.party" ||
// thanks to beeznutsonly on github: https://github.com/qsniyg/maxurl/issues/1275
domain_nosub === "kemono.su" ||
// thanks to vscum on github: https://github.com/qsniyg/maxurl/pull/1137
domain_nosub === "coomer.party") {
domain_nosub === "coomer.party" ||
// thanks to beeznutsonly on github: https://github.com/qsniyg/maxurl/issues/1276
domain_nosub === "coomer.su") {
// thanks to BrandonKMLee on github: https://github.com/qsniyg/maxurl/issues/1093
// https://kemono.party/thumbnail/data/30/34/3034877e08c6b13c03db53879464858ae4a4f8f2360c7755d16a241a2613e12c.png
// https://data65.kemono.party/data/30/34/3034877e08c6b13c03db53879464858ae4a4f8f2360c7755d16a241a2613e12c.png
Expand Down

0 comments on commit 7d72ec6

Please sign in to comment.