Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Aug 4, 2024
1 parent d066578 commit 097bfab
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
18 changes: 14 additions & 4 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29590,6 +29590,9 @@ var $$IMU_EXPORT$$;
// https://m.media-amazon.com/images/M/MV5BYmY4NTExN2MtOWZjMy00NWU0LWIzZDMtMzQ4NThjNGM3OGU0XkEyXkFqcGdeQXVyOTc5MDI5NjE@.jpeg
// https://m.media-amazon.com/images/M/MV5BOGFkMTZkYmYtNTliNy00N2U3LTkyZjQtYTIxNjEyY2I5MjhiXkEyXkFqcGdeQXVyOTc5MDI5NjE@.UX1000.jpeg -- upscaled
// https://m.media-amazon.com/images/M/MV5BOGFkMTZkYmYtNTliNy00N2U3LTkyZjQtYTIxNjEyY2I5MjhiXkEyXkFqcGdeQXVyOTc5MDI5NjE@.jpeg -- original
// thanks to nimbuz on discord:
// https://m.media-amazon.com/images/I/A13usaonutL._CLa%7C2140%2C2000%7C91ZCXdqRg0L.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.0_AC_SX466_.png
// https://m.media-amazon.com/images/I/A13usaonutL._CLa%7C2140%2C2000%7C91ZCXdqRg0L.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.png
domain_nosub === "media-amazon.com" ||
// https://ia.media-imdb.com/images/M/MV5BNjA1NDYwMDQ3MF5BMl5BanBnXkFtZTcwOTYyNDQ0MQ@@._V1_UY268_CR1,0,182,268_AL_.jpg
// https://ia.media-imdb.com/images/M/MV5BNjA1NDYwMDQ3MF5BMl5BanBnXkFtZTcwOTYyNDQ0MQ@@.jpg
Expand Down Expand Up @@ -29617,7 +29620,7 @@ var $$IMU_EXPORT$$;
};

let parse_directives = function(url) {
let match = url.match(/((?:\.+_*(?:[A-Z][A-Z0-9]|V_)[^/.]*)+)\.+[^/.]+(?:[?#].*)?$/);
let match = url.match(/((?:\.+_*(?:0_)?(?:[A-Z][A-Z0-9]|V_)[^/.]*)+)\.+[^/.]+(?:[?#].*)?$/);
if (!match)
return null;

Expand All @@ -29628,7 +29631,7 @@ var $$IMU_EXPORT$$;
if (!directive || !directive.length)
continue;

let dmatch = directive.match(/^([A-Z][A-Z0-9]|V)(.*)?$/);
let dmatch = directive.match(/^([A-Z][A-Z0-9]|V|0)(.*)?$/);
if (!dmatch) {
console_warn("Invalid directive", directive, "for URL", url);
return null;
Expand All @@ -29654,7 +29657,7 @@ var $$IMU_EXPORT$$;
if (!stringified_arr.length)
stringified = "";

let urlmatch = url.match(/^(.*\/[^/]+?)(?:\.+_*(?:[A-Z][A-Z0-9]|V_)[^/.]*)*\.*(\.[^/.]+(?:[?#].*)?)$/);
let urlmatch = url.match(/^(.*\/[^/]+?)(?:\.+_*(?:0_)?(?:[A-Z][A-Z0-9]|V_)[^/.]*)*\.*(\.[^/.]+(?:[?#].*)?)$/);
if (!urlmatch) {
console_warn("Unable to find URL match for", url);
return url;
Expand Down Expand Up @@ -29682,6 +29685,7 @@ var $$IMU_EXPORT$$;
directive.key === "SY" ||
directive.key === "V" ||
directive.key === "BG" || // background color
directive.key === "0" ||
directive.key === "CB") {
continue;
}
Expand Down Expand Up @@ -51656,7 +51660,7 @@ var $$IMU_EXPORT$$;
if ((domain_nosub === "staticflickr.com" ||
domain === "static.flickr.com" ||
(domain_nosub === "flickr.com" && string_indexof(domain, ".static.flickr.com") >= 0)) &&
(src.match(/\/[0-9]+_[0-9a-f]+(?:_[a-z0-9]*)?\.[a-z]+.*$/) || /\/video\/+[0-9]+\/+[0-9a-f]+\/+/.test(src)) &&
(src.match(/\/[0-9]+_[0-9a-f]+(?:_[a-z0-9]*)*\.[a-z]+.*$/) || /\/video\/+[0-9]+\/+[0-9a-f]+\/+/.test(src)) &&
options && options.do_request && options.cb) {
// https://c1.staticflickr.com/5/4190/34341416210_29e6098b30.jpg
// https://farm5.staticflickr.com/4190/34341416210_9f14cc1576_o.jpg
Expand All @@ -51672,6 +51676,8 @@ var $$IMU_EXPORT$$;
// https://live.staticflickr.com/65535/48913730532_c31a823c53_o.jpg
// https://live.staticflickr.com/31337/49782135648_bff29ec44e_b.jpg
// https://live.staticflickr.com/video/49782135648/bff29ec44e/1080p.mp4
// thanks to anonymous for reporting:
// https://live.staticflickr.com/2624/4134813569_42c3f585de_b_d.jpg

var find_photoid_secret_from_url = function(src) {
var match = src.match(/\/video\/+([0-9]+)\/+([0-9a-f]+)\/+/);
Expand Down Expand Up @@ -82845,6 +82851,10 @@ var $$IMU_EXPORT$$;
// https://www.theleader.com.au/images/transform/v1/crop/frm/137578502/6e23b1ab-793d-48fb-b7c6-17cae54099bd.jpg
// https://www.theleader.com.au/images/transform/v1/resize/frm/137578502/6e23b1ab-793d-48fb-b7c6-17cae54099bd.jpg/w0_h0_fscale.jpg
domain_nowww === "theleader.com.au" ||
// thanks to anonymous for reporting:
// https://www.examiner.com.au/images/transform/v1/crop/frm/storypad-C3fzmZSeE4zEq4PyG5Utt8/84d63f34-e4b0-400e-abb7-f02e54f9c253.jpg/r2_0_5182_2914_w1200_h678_fmax.jpg
// https://www.examiner.com.au/images/transform/v1/resize/frm/storypad-C3fzmZSeE4zEq4PyG5Utt8/84d63f34-e4b0-400e-abb7-f02e54f9c253.jpg/w0_h0_fscale.jpg
domain_nowww === "examiner.com.au" ||
// https://www.northweststar.com.au/images/transform/v1/crop/frm/Y5kUJ9Q7iPMNzBC9i5WqCU/a68e9967-e0cd-4818-a227-878719e98f65.jpg/r0_0_1200_677_w1200_h678_fmax.jpg
// https://www.northweststar.com.au/images/transform/v1/resize/frm/Y5kUJ9Q7iPMNzBC9i5WqCU/a68e9967-e0cd-4818-a227-878719e98f65.jpg/w0_h0_fscale.jpg
domain_nowww === "northweststar.com.au") {
Expand Down
18 changes: 14 additions & 4 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -27004,6 +27004,9 @@ var $$IMU_EXPORT$$;
// https://m.media-amazon.com/images/M/MV5BYmY4NTExN2MtOWZjMy00NWU0LWIzZDMtMzQ4NThjNGM3OGU0XkEyXkFqcGdeQXVyOTc5MDI5NjE@.jpeg
// https://m.media-amazon.com/images/M/MV5BOGFkMTZkYmYtNTliNy00N2U3LTkyZjQtYTIxNjEyY2I5MjhiXkEyXkFqcGdeQXVyOTc5MDI5NjE@.UX1000.jpeg -- upscaled
// https://m.media-amazon.com/images/M/MV5BOGFkMTZkYmYtNTliNy00N2U3LTkyZjQtYTIxNjEyY2I5MjhiXkEyXkFqcGdeQXVyOTc5MDI5NjE@.jpeg -- original
// thanks to nimbuz on discord:
// https://m.media-amazon.com/images/I/A13usaonutL._CLa%7C2140%2C2000%7C91ZCXdqRg0L.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.0_AC_SX466_.png
// https://m.media-amazon.com/images/I/A13usaonutL._CLa%7C2140%2C2000%7C91ZCXdqRg0L.png%7C0%2C0%2C2140%2C2000%2B0.0%2C0.0%2C2140.0%2C2000.png
domain_nosub === "media-amazon.com" ||
// https://ia.media-imdb.com/images/M/MV5BNjA1NDYwMDQ3MF5BMl5BanBnXkFtZTcwOTYyNDQ0MQ@@._V1_UY268_CR1,0,182,268_AL_.jpg
// https://ia.media-imdb.com/images/M/MV5BNjA1NDYwMDQ3MF5BMl5BanBnXkFtZTcwOTYyNDQ0MQ@@.jpg
Expand All @@ -27030,7 +27033,7 @@ var $$IMU_EXPORT$$;
bad: "mask"
};
var parse_directives = function(url) {
var match = url.match(/((?:\.+_*(?:[A-Z][A-Z0-9]|V_)[^/.]*)+)\.+[^/.]+(?:[?#].*)?$/);
var match = url.match(/((?:\.+_*(?:0_)?(?:[A-Z][A-Z0-9]|V_)[^/.]*)+)\.+[^/.]+(?:[?#].*)?$/);
if (!match)
return null;
var raw_directives = match[1].replace(/\./g, "_").replace(/_+/g, "_").split("_");
Expand All @@ -27039,7 +27042,7 @@ var $$IMU_EXPORT$$;
var directive = raw_directives_1[_i];
if (!directive || !directive.length)
continue;
var dmatch = directive.match(/^([A-Z][A-Z0-9]|V)(.*)?$/);
var dmatch = directive.match(/^([A-Z][A-Z0-9]|V|0)(.*)?$/);
if (!dmatch) {
console_warn("Invalid directive", directive, "for URL", url);
return null;
Expand All @@ -27060,7 +27063,7 @@ var $$IMU_EXPORT$$;
var stringified = "._" + stringified_arr.join("_") + "_";
if (!stringified_arr.length)
stringified = "";
var urlmatch = url.match(/^(.*\/[^/]+?)(?:\.+_*(?:[A-Z][A-Z0-9]|V_)[^/.]*)*\.*(\.[^/.]+(?:[?#].*)?)$/);
var urlmatch = url.match(/^(.*\/[^/]+?)(?:\.+_*(?:0_)?(?:[A-Z][A-Z0-9]|V_)[^/.]*)*\.*(\.[^/.]+(?:[?#].*)?)$/);
if (!urlmatch) {
console_warn("Unable to find URL match for", url);
return url;
Expand All @@ -27087,6 +27090,7 @@ var $$IMU_EXPORT$$;
directive.key === "SY" ||
directive.key === "V" ||
directive.key === "BG" || // background color
directive.key === "0" ||
directive.key === "CB") {
continue;
}
Expand Down Expand Up @@ -47145,7 +47149,7 @@ var $$IMU_EXPORT$$;
if ((domain_nosub === "staticflickr.com" ||
domain === "static.flickr.com" ||
(domain_nosub === "flickr.com" && string_indexof(domain, ".static.flickr.com") >= 0)) &&
(src.match(/\/[0-9]+_[0-9a-f]+(?:_[a-z0-9]*)?\.[a-z]+.*$/) || /\/video\/+[0-9]+\/+[0-9a-f]+\/+/.test(src)) &&
(src.match(/\/[0-9]+_[0-9a-f]+(?:_[a-z0-9]*)*\.[a-z]+.*$/) || /\/video\/+[0-9]+\/+[0-9a-f]+\/+/.test(src)) &&
options && options.do_request && options.cb) {
// https://c1.staticflickr.com/5/4190/34341416210_29e6098b30.jpg
// https://farm5.staticflickr.com/4190/34341416210_9f14cc1576_o.jpg
Expand All @@ -47161,6 +47165,8 @@ var $$IMU_EXPORT$$;
// https://live.staticflickr.com/65535/48913730532_c31a823c53_o.jpg
// https://live.staticflickr.com/31337/49782135648_bff29ec44e_b.jpg
// https://live.staticflickr.com/video/49782135648/bff29ec44e/1080p.mp4
// thanks to anonymous for reporting:
// https://live.staticflickr.com/2624/4134813569_42c3f585de_b_d.jpg
var find_photoid_secret_from_url = function(src) {
var match = src.match(/\/video\/+([0-9]+)\/+([0-9a-f]+)\/+/);
if (!match) {
Expand Down Expand Up @@ -74705,6 +74711,10 @@ var $$IMU_EXPORT$$;
// https://www.theleader.com.au/images/transform/v1/crop/frm/137578502/6e23b1ab-793d-48fb-b7c6-17cae54099bd.jpg
// https://www.theleader.com.au/images/transform/v1/resize/frm/137578502/6e23b1ab-793d-48fb-b7c6-17cae54099bd.jpg/w0_h0_fscale.jpg
domain_nowww === "theleader.com.au" ||
// thanks to anonymous for reporting:
// https://www.examiner.com.au/images/transform/v1/crop/frm/storypad-C3fzmZSeE4zEq4PyG5Utt8/84d63f34-e4b0-400e-abb7-f02e54f9c253.jpg/r2_0_5182_2914_w1200_h678_fmax.jpg
// https://www.examiner.com.au/images/transform/v1/resize/frm/storypad-C3fzmZSeE4zEq4PyG5Utt8/84d63f34-e4b0-400e-abb7-f02e54f9c253.jpg/w0_h0_fscale.jpg
domain_nowww === "examiner.com.au" ||
// https://www.northweststar.com.au/images/transform/v1/crop/frm/Y5kUJ9Q7iPMNzBC9i5WqCU/a68e9967-e0cd-4818-a227-878719e98f65.jpg/r0_0_1200_677_w1200_h678_fmax.jpg
// https://www.northweststar.com.au/images/transform/v1/resize/frm/Y5kUJ9Q7iPMNzBC9i5WqCU/a68e9967-e0cd-4818-a227-878719e98f65.jpg/w0_h0_fscale.jpg
domain_nowww === "northweststar.com.au") {
Expand Down

0 comments on commit 097bfab

Please sign in to comment.