Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Sep 19, 2024
1 parent e9fa0a8 commit 355f834
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 49 deletions.
63 changes: 46 additions & 17 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21264,7 +21264,13 @@ var $$IMU_EXPORT$$;
return array_to_sort;
};

var parse_tag_def = function(tag:string) {
type ParsedTagDef = {
tagname: string,
selfclosing: boolean,
args: Record<string, string>
args_array: Array<{name: string, value: string}>
};
var parse_tag_def = function(tag:string):ParsedTagDef {
var match = tag.match(/^<([-a-zA-Z0-9]+)((?:\s+[-a-z0-9A-Z]+(?:=(?:"[^"]*"|'[^']*'|[-_a-zA-Z0-9]+))?)*)\s*(\/?)>/);

if (!match) {
Expand Down Expand Up @@ -76416,10 +76422,10 @@ var $$IMU_EXPORT$$;
};

var parse_pictures_json = function(json) {
var images = [];
let images = [];

for (var i = 0; i < json.length; i++) {
var image = {};
for (let i = 0; i < json.length; i++) {
let image:Record<string, string|null> = {};

image.full = json[i].srcFull;
image.id = get_thumborid_for_flixster(image.full);
Expand Down Expand Up @@ -76455,10 +76461,10 @@ var $$IMU_EXPORT$$;
};

var parse_imagesjson = function(json) {
var images = [];
let images = [];

for (var i = 0; i < json.length; i++) {
var image = {};
for (let i = 0; i < json.length; i++) {
let image:Record<string, string|null> = {};

image.id = json[i].thumborId;
image.full = json[i].urls.fullscreen;
Expand Down Expand Up @@ -79628,7 +79634,7 @@ var $$IMU_EXPORT$$;
return done(null, false);
}

var obj = {
var obj:BigImageInfoSObject = {
url: images[main_image],
extra: extra,
headers: {
Expand Down Expand Up @@ -87209,7 +87215,7 @@ var $$IMU_EXPORT$$;
return done(null, false);
}

var obj = {
var obj:BigImageInfoSObject = {
extra: {
page: resp.finalUrl
}
Expand Down Expand Up @@ -87973,7 +87979,7 @@ var $$IMU_EXPORT$$;
process: function(done, resp, cache_key) {
api_cache.set("gettyimages_domain", resp.finalUrl.replace(/^[a-z]+:\/\/([^/]+)\/+.*/, "$1"), 6*60*60);

var obj = {
var obj:BigImageInfoSObject = {
extra: {
// remove country codes related to IP
page: resp.finalUrl.replace(/(:\/\/www\.gettyimages\.)[^/]+\//, "://www.gettyimages.com/")
Expand Down Expand Up @@ -88930,7 +88936,7 @@ var $$IMU_EXPORT$$;
website_regex: /^[a-z]+:\/\/[^/]+\/+editorial\/+image-editorial\/+(?:[^/?#]+-)?([0-9]+[a-z]+)(?:[?#].*)?$/,
query_for_id: "https://www.shutterstock.com/editorial/image-editorial/${id}",
process: function(done, resp, cache_key) {
var obj = {
var obj:BigImageInfoSObject = {
extra: {
page: resp.finalUrl
}
Expand Down Expand Up @@ -91888,7 +91894,7 @@ var $$IMU_EXPORT$$;
};
}

if ((domain_nosub === "gfycat.com" || domain_nosub === "redgifs.com") && (/^(?:th(?:umbs|cf)[0-9]*|zippy|giant)\./.test(domain))) {
if ((domain_nosub === "gfycat.com" || domain_nosub === "redgifs.com") && (/^(?:th(?:umbs|cf)[0-9]*|zippy|giant|files)\./.test(domain))) {
match = src.match(/^[a-z]+:\/\/[^/]+\/+([^-./]+)[-.]/);
if (match) {
var watch = "/";
Expand Down Expand Up @@ -92590,7 +92596,7 @@ var $$IMU_EXPORT$$;
console_error(cache_key, "Unable to find url for", resp);
}

var obj = {
var obj:BigImageInfoSObject = {
url: url,
extra: {
page: resp.finalUrl
Expand Down Expand Up @@ -92791,9 +92797,9 @@ var $$IMU_EXPORT$$;
website_regex: /^[a-z]+:\/\/[^/]+\/+Read\/+Index\/+([0-9]+)(?:[?#].*)?$/,
query_for_id: "https://www.tsumino.com/Read/Index/${id}",
override_cb: function(cb, data) {
var page = 1;
var page:string|number = 1;
var queries = get_queries(src);
if (queries.page) page = queries.page;
if (queries.page) page = queries.page + "";

common_functions["update_album_info_links"](data, function(x) {
var match = x.match(/\/[0-9]+\/+([0-9]+)\?/);
Expand Down Expand Up @@ -92928,7 +92934,7 @@ var $$IMU_EXPORT$$;

var videourl = match[1];

var baseobj = {
var baseobj:BigImageInfoSObject = {
extra: {
page: resp.finalUrl
}
Expand Down Expand Up @@ -93096,7 +93102,7 @@ var $$IMU_EXPORT$$;
};

var likee_json_to_obj = function(resp, json) {
var obj = {
var obj:BigImageInfoSObject = {
extra: {
page: resp ? resp.finalUrl : null
}
Expand Down Expand Up @@ -116656,6 +116662,29 @@ var $$IMU_EXPORT$$;
return src.replace(/(\/images\/+pics\/+)[0-9]+\/+/, "$1");
}

if (domain === "img.hdseries.cc" ||
// https://img.goku.sx/xxrz/250x400/576/07/68/0768fd5ee5450a60532270c3a2eb06e8/0768fd5ee5450a60532270c3a2eb06e8.jpg
// https://img.goku.sx/xxrz/99999x99999/100/07/68/0768fd5ee5450a60532270c3a2eb06e8/0768fd5ee5450a60532270c3a2eb06e8.jpg
domain === "img.goku.sx" ||
// https://img.curiousanimal.tv/xxrz/250x400/1117/3b/23/3b23b68886b33f8881de82da4b5241db/3b23b68886b33f8881de82da4b5241db.jpg
// https://img.curiousanimal.tv/xxrz/99999x99999/100/3b/23/3b23b68886b33f8881de82da4b5241db/3b23b68886b33f8881de82da4b5241db.jpg
domain === "img.curiousanimal.tv" ||
// https://img.myflixerz.to/xxrz/250x400/201/14/1e/141e0669171ded5ede579b4f3fe21835/141e0669171ded5ede579b4f3fe21835.jpg
// https://img.myflixerz.to/xxrz/99999x99999/100/14/1e/141e0669171ded5ede579b4f3fe21835/141e0669171ded5ede579b4f3fe21835.jpg
domain === "img.myflixerz.to") {
// thanks to anonymous for reporting:
// https://img.hdseries.cc/xxrz/1280x720/100/83/b4/83b4c8018dd42da223242fb8b34d5c56/83b4c8018dd42da223242fb8b34d5c56.jpg
// https://img.hdseries.cc/xxrz/99999x99999/100/83/b4/83b4c8018dd42da223242fb8b34d5c56/83b4c8018dd42da223242fb8b34d5c56.jpg
return src.replace(/\/xxrz\/+[0-9]+x[0-9]+\/+[0-9]+\/+/, "/xxrz/99999x99999/100/");
}

if (domain === "lirp.cdn-website.com") {
// thanks to remlap:
// https://lirp.cdn-website.com/15061b4e/dms3rep/multi/opt/57408_05-1920w.jpg
// https://irp.cdn-website.com/15061b4e/dms3rep/multi/57408_05.jpg
return src.replace(/(:\/\/)l(.*)\/opt\/+([^/]+)-[0-9]+w\./, "$1$2/$3.")
}




Expand Down
85 changes: 53 additions & 32 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -69254,11 +69254,11 @@ var $$IMU_EXPORT$$;
};
var parse_pictures_json = function(json) {
var images = [];
for (var i = 0; i < json.length; i++) {
for (var i_8 = 0; i_8 < json.length; i_8++) {
var image = {};
image.full = json[i].srcFull;
image.full = json[i_8].srcFull;
image.id = get_thumborid_for_flixster(image.full);
image.caption = json[i].caption || null;
image.caption = json[i_8].caption || null;
images.push(image);
}
return images;
Expand All @@ -69284,11 +69284,11 @@ var $$IMU_EXPORT$$;
};
var parse_imagesjson = function(json) {
var images = [];
for (var i = 0; i < json.length; i++) {
for (var i_9 = 0; i_9 < json.length; i_9++) {
var image = {};
image.id = json[i].thumborId;
image.full = json[i].urls.fullscreen;
image.caption = json[i].caption || json[i].alt || null;
image.id = json[i_9].thumborId;
image.full = json[i_9].urls.fullscreen;
image.caption = json[i_9].caption || json[i_9].alt || null;
images.push(image);
}
return images;
Expand Down Expand Up @@ -82799,7 +82799,7 @@ var $$IMU_EXPORT$$;
is_pagelink: true
};
}
if ((domain_nosub === "gfycat.com" || domain_nosub === "redgifs.com") && (/^(?:th(?:umbs|cf)[0-9]*|zippy|giant)\./.test(domain))) {
if ((domain_nosub === "gfycat.com" || domain_nosub === "redgifs.com") && (/^(?:th(?:umbs|cf)[0-9]*|zippy|giant|files)\./.test(domain))) {
match = src.match(/^[a-z]+:\/\/[^/]+\/+([^-./]+)[-.]/);
if (match) {
var watch = "/";
Expand Down Expand Up @@ -83593,7 +83593,7 @@ var $$IMU_EXPORT$$;
var page = 1;
var queries = get_queries(src);
if (queries.page)
page = queries.page;
page = queries.page + "";
common_functions["update_album_info_links"](data, function(x) {
var match = x.match(/\/[0-9]+\/+([0-9]+)\?/);
if (!match) {
Expand Down Expand Up @@ -84865,10 +84865,10 @@ var $$IMU_EXPORT$$;
match = src.match(regex);
if (match) {
var obj_4 = [];
for (var i_8 = 0; i_8 < sizes_1.length; i_8++) {
if (sizes_1[i_8] <= match[1])
for (var i_10 = 0; i_10 < sizes_1.length; i_10++) {
if (sizes_1[i_10] <= match[1])
break;
obj_4.push(src.replace(regex, "$1" + sizes_1[i_8] + "$3"));
obj_4.push(src.replace(regex, "$1" + sizes_1[i_10] + "$3"));
}
return obj_4;
}
Expand Down Expand Up @@ -86201,8 +86201,8 @@ var $$IMU_EXPORT$$;
var sizes_index = array_indexof(sizes, match[2]);
var urls = [];
if (sizes_index >= 0) {
for (var i_9 = 0; i_9 < sizes_index; i_9++) {
urls.push(match[1] + "-" + sizes[i_9] + match[3]);
for (var i_11 = 0; i_11 < sizes_index; i_11++) {
urls.push(match[1] + "-" + sizes[i_11] + match[3]);
}
return urls;
}
Expand Down Expand Up @@ -88949,8 +88949,8 @@ var $$IMU_EXPORT$$;
if (match) {
var splitted = decodeURIComponent(match[1]).split("_");
var splitted1 = [];
for (var i_10 = 0; i_10 < splitted.length; i_10++) {
splitted1.push(base64_decode(splitted[i_10]));
for (var i_12 = 0; i_12 < splitted.length; i_12++) {
splitted1.push(base64_decode(splitted[i_12]));
}
return {
url: splitted1.join("?"),
Expand Down Expand Up @@ -89107,14 +89107,14 @@ var $$IMU_EXPORT$$;
strings.push(decoded2);
}
var found_1 = false;
for (var i_11 = 0; i_11 < strings.length; i_11++) {
strings[i_11] = strings[i_11].replace(/#/g, "-");
var newsrc = strings[i_11].replace(/^.*?(https?:\/\/)/, "$1");
if (newsrc !== strings[i_11]) {
for (var i_13 = 0; i_13 < strings.length; i_13++) {
strings[i_13] = strings[i_13].replace(/#/g, "-");
var newsrc = strings[i_13].replace(/^.*?(https?:\/\/)/, "$1");
if (newsrc !== strings[i_13]) {
found_1 = true;
strings[i_11] = newsrc;
if (i_11 > 0) {
strings.splice(0, i_11);
strings[i_13] = newsrc;
if (i_13 > 0) {
strings.splice(0, i_13);
}
break;
}
Expand Down Expand Up @@ -89429,8 +89429,8 @@ var $$IMU_EXPORT$$;
if (match) {
try {
var splitted = match[1].split("_");
for (var i_12 = 0; i_12 < splitted.length; i_12++) {
splitted[i_12] = base64_decode(splitted[i_12]);
for (var i_14 = 0; i_14 < splitted.length; i_14++) {
splitted[i_14] = base64_decode(splitted[i_14]);
}
var jsonstr = splitted.join("?");
var json = JSON_parse(jsonstr);
Expand Down Expand Up @@ -89877,8 +89877,8 @@ var $$IMU_EXPORT$$;
var splitted = match[1].split(/\/+/g);
var splitted_dec = [];
try {
for (var i_13 = 0; i_13 < splitted.length; i_13++) {
splitted_dec[i_13] = base64_decode(splitted[i_13]);
for (var i_15 = 0; i_15 < splitted.length; i_15++) {
splitted_dec[i_15] = base64_decode(splitted[i_15]);
}
var json = JSON_parse(splitted_dec.join(""));
console_log(json);
Expand Down Expand Up @@ -101645,9 +101645,9 @@ var $$IMU_EXPORT$$;
try {
var decoded_6 = base64_decode(match[1]);
var newstr = null;
for (var i_14 = 1; i_14 < decoded_6.length; i_14++) {
if (decoded_6[i_14] === "u" && decoded_6.charCodeAt(i_14 - 1) === 1) {
newstr = decoded_6.substr(i_14);
for (var i_16 = 1; i_16 < decoded_6.length; i_16++) {
if (decoded_6[i_16] === "u" && decoded_6.charCodeAt(i_16 - 1) === 1) {
newstr = decoded_6.substr(i_16);
if (/^upic\//.test(newstr))
break;
newstr = null;
Expand Down Expand Up @@ -104614,8 +104614,8 @@ var $$IMU_EXPORT$$;
common_functions["update_album_info_links"](obj, function(x) {
var ids = x.split("|");
for (var _i = 0, ids_1 = ids; _i < ids_1.length; _i++) {
var i_15 = ids_1[_i];
if (imu_imageid === i_15)
var i_17 = ids_1[_i];
if (imu_imageid === i_17)
return true;
}
return false;
Expand Down Expand Up @@ -104839,6 +104839,27 @@ var $$IMU_EXPORT$$;
// https://www.dsreps.com/images/pics/Jhxe0c_nike_trail_fa24_tour-du-mont-blanc_social_post_01ejpeg.jpg
return src.replace(/(\/images\/+pics\/+)[0-9]+\/+/, "$1");
}
if (domain === "img.hdseries.cc" ||
// https://img.goku.sx/xxrz/250x400/576/07/68/0768fd5ee5450a60532270c3a2eb06e8/0768fd5ee5450a60532270c3a2eb06e8.jpg
// https://img.goku.sx/xxrz/99999x99999/100/07/68/0768fd5ee5450a60532270c3a2eb06e8/0768fd5ee5450a60532270c3a2eb06e8.jpg
domain === "img.goku.sx" ||
// https://img.curiousanimal.tv/xxrz/250x400/1117/3b/23/3b23b68886b33f8881de82da4b5241db/3b23b68886b33f8881de82da4b5241db.jpg
// https://img.curiousanimal.tv/xxrz/99999x99999/100/3b/23/3b23b68886b33f8881de82da4b5241db/3b23b68886b33f8881de82da4b5241db.jpg
domain === "img.curiousanimal.tv" ||
// https://img.myflixerz.to/xxrz/250x400/201/14/1e/141e0669171ded5ede579b4f3fe21835/141e0669171ded5ede579b4f3fe21835.jpg
// https://img.myflixerz.to/xxrz/99999x99999/100/14/1e/141e0669171ded5ede579b4f3fe21835/141e0669171ded5ede579b4f3fe21835.jpg
domain === "img.myflixerz.to") {
// thanks to anonymous for reporting:
// https://img.hdseries.cc/xxrz/1280x720/100/83/b4/83b4c8018dd42da223242fb8b34d5c56/83b4c8018dd42da223242fb8b34d5c56.jpg
// https://img.hdseries.cc/xxrz/99999x99999/100/83/b4/83b4c8018dd42da223242fb8b34d5c56/83b4c8018dd42da223242fb8b34d5c56.jpg
return src.replace(/\/xxrz\/+[0-9]+x[0-9]+\/+[0-9]+\/+/, "/xxrz/99999x99999/100/");
}
if (domain === "lirp.cdn-website.com") {
// thanks to remlap:
// https://lirp.cdn-website.com/15061b4e/dms3rep/multi/opt/57408_05-1920w.jpg
// https://irp.cdn-website.com/15061b4e/dms3rep/multi/57408_05.jpg
return src.replace(/(:\/\/)l(.*)\/opt\/+([^/]+)-[0-9]+w\./, "$1$2/$3.");
}
// -- general rules --
if (src.match(/\/ImageGen\.ashx\?/)) {
// http://www.lookalikes.info/umbraco/ImageGen.ashx?image=/media/97522/nick%20hewer%20-%20mark%20brown.jpeg&width=250&constrain=true
Expand Down

0 comments on commit 355f834

Please sign in to comment.