Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Apr 3, 2024
1 parent 15cbbf6 commit 085b4f8
Show file tree
Hide file tree
Showing 2 changed files with 308 additions and 6 deletions.
164 changes: 161 additions & 3 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31420,7 +31420,11 @@ var $$IMU_EXPORT$$;
domain === "invidious.einfachzocken.eu" ||
domain === "invidious.nerdvpn.de" ||
domain === "inv.n8pjl.ca" ||
domain === "youtube.owacon.moe") {
domain === "youtube.owacon.moe" ||
domain === "invidious.jing.rocks" ||
domain === "vid.lilay.dev" ||
domain === "inv.oikei.net" ||
domain === "invidious.privacyredirect.com") {
// https://invidio.us/vi/814QFJ4mDaM/mqdefault.jpg
newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(vi\/+.*?)(?:[?#].*)?$/, "https://i.ytimg.com/$1");
if (newsrc !== src)
Expand Down Expand Up @@ -31735,6 +31739,9 @@ var $$IMU_EXPORT$$;
domain === "cdn-imgix-open.headout.com" ||
// https://images.assettype.com/mediaone%2F2018-06%2F2da714b8-3908-47f6-86fa-8a88ea1ef9d8%2Femma_stone.jpg?w=480&auto=format%2Ccompress&fit=max
domain === "images.assettype.com" ||
// thanks to anonymous for reporting:
// https://media.assettype.com/bdnews24-english%2F2023-10%2F43ab7fbd-585d-4834-a210-edd83e85a707%2Fniger_junta_111023_01.jpeg?auto=format%2Ccompress&fit=max&w=732
domain === "media.assettype.com" ||
// https://images.seoghoer.dk/s3fs-public/storage_1/media/kylie_jenner_1.jpg?ixlib=imgixjs-3.4.0&w=200
domain === "images.seoghoer.dk" ||
// https://static.camp-fire.jp/uploads/project_version/image/390115/00102017-a11b-48ed-8d7f-fad2faa496b4.jpg?ixlib=rails-2.1.4&auto=format&w=500
Expand Down Expand Up @@ -41823,6 +41830,18 @@ var $$IMU_EXPORT$$;
// https://static.themezy.com/system/resources/previews/000/000/244/non_2x/web-designer-portfolio-website-template.jpg
// https://static.themezy.com/system/resources/previews/000/000/244/original/web-designer-portfolio-website-template.jpg
domain === "static.themezy.com" ||
// thanks to anonymous for reporting:
// https://static.vecteezy.com/system/resources/thumbnails/002/727/618/small_2x/american-football-balloon-isolated-icon-free-vector.jpg
// https://static.vecteezy.com/system/resources/previews/002/727/618/original/american-football-balloon-isolated-icon-free-vector.jpg
// https://static.vecteezy.com/system/resources/previews/002/187/079/non_2x/football-icon-set-vector.jpg
// https://static.vecteezy.com/system/resources/previews/002/187/079/original/football-icon-set-vector.jpg
// doesn't work for all:
// https://static.vecteezy.com/system/resources/thumbnails/039/344/819/small/1800-backgrounds-and-textures-bundle.png
//
// https://www.vecteezy.com/vector-art/266318-american-footbal-emblem-orange-ball
// https://static.vecteezy.com/system/resources/thumbnails/000/266/318/small_2x/American_Football_Emblems_Vector_RON_10.jpg
// https://static.vecteezy.com/system/resources/previews/000/266/318/original/american-footbal-emblem-orange-ball-vector.jpg
domain === "static.vecteezy.com" ||
// https://hairhapi.com/images/item_images/images/000/037/150/medium/27b4ce4e-b343-4d78-a4f4-7d610099257f.jpg
// https://hairhapi.com/images/item_images/images/000/037/150/original/27b4ce4e-b343-4d78-a4f4-7d610099257f.jpg
domain_nowww === "hairhapi.com" ||
Expand All @@ -41847,6 +41866,7 @@ var $$IMU_EXPORT$$;
// https://sonarreykjavik.com/system/attached_images/19379/original/BadGyal_AlexisG%C3%B3mez.jpg?1513685256
return src
.replace(/(\/attached_images\/+[0-9]+\/+)[a-z]+\/+/, "$1original/")
.replace(/(\/system\/+resources\/+)thumbnails\/+/, "$1previews/")
.replace(/(\/(?:(?:system|images)\/+)?(?:(?:attached|item)_images|App\/+BlogBody|post_pictures|events|posts|items|articles|file_uploads|screenshots|resources|pictures|guides|Image|item_cocreco_images)\/+(?:(?:images|photos|files|assets|pictures|posters|uploads|screenshots|previews|imgs|cropped_images)\/+)?(?:[0-9]{3}\/+){3})[a-z_0-9]+\/+/, "$1original/");
//return src.replace(/(\/system\/(?:post_pictures\/(?:files|assets|pictures)\/|posts\/posters\/|events\/images\/)(?:[0-9]+\/){3})[a-z]+(\/[^/]*)$/, "$1original$2");
//return src.replace(/\/[a-z]*\/([-0-9a-f]*\.[^/.]*)$/, "/original/$1");
Expand Down Expand Up @@ -42648,6 +42668,8 @@ var $$IMU_EXPORT$$;
if ((domain_nosub === "goodfon.com" ||
// https://img1.goodfon.ru/original/2560x1440/8/18/devochka-povyazka-kniga-bluzka.jpg
// https://img1.goodfon.ru/wallpaper/original/8/18/devochka-povyazka-kniga-bluzka.jpg
// https://img.goodfon.ru/wallpaper/big/9/66/ohashi-bridge-kobe-japan.webp
// https://img.goodfon.ru/wallpaper/original/9/66/ohashi-bridge-kobe-japan.jpg
domain_nosub === "goodfon.ru" ||
// https://img3.badfon.ru/wallpaper/big/c/b0/devushka-nagota-dlinnye-volosy.jpg
// https://img3.badfon.ru/wallpaper/original/c/b0/devushka-nagota-dlinnye-volosy.jpg
Expand All @@ -42657,7 +42679,12 @@ var $$IMU_EXPORT$$;
// https://img4.goodfon.com/wallpaper/original/2/86/brevno-sova-ptitsa.jpg
// https://img2.goodfon.com/original/1280x720/0/e6/venera-ray-devushka-krasivaya.jpg
// https://img2.goodfon.com/wallpaper/original/0/e6/venera-ray-devushka-krasivaya.jpg
return src.replace(/(:\/\/[^/]*\/)[^/]*\/[^/]*\//, "$1wallpaper/original/");
newsrc = src.replace(/(:\/\/[^/]*\/)[^/]*\/[^/]*\//, "$1wallpaper/original/");
if (newsrc !== src)
return newsrc;

if (/\.webp(?:[?#].*)?$/.test(src))
return src.replace(/\.webp(?:[?#].*)?$/, ".jpg");
//return src.replace(/\/wallpaper\/[^/]*\//, "/wallpaper/original/");
}

Expand Down Expand Up @@ -44281,6 +44308,45 @@ var $$IMU_EXPORT$$;
return newsrc;
}

if (domain_nowww === "tnaflix.com") {
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+\/+[^/]+\/+video([0-9]+)(?:[?#].*)?$/,
query_for_id(id) {
return {
url: "https://www." + domain_nosub + "/ajax/video-player/" + id,
headers: {
Accept: "*/*",
Referer: "https://" + domain + "/"
},
imu_mode: "xhr",
json: true
}
},
process(done, resp, cache_key) {
if (!resp.html) {
console_error(cache_key, "Unable to find html from", resp);
return done(null, false);
}

let fakeresp = {
responseText: resp.html,
finalUrl: "https://www.tnaflix.com/"
};

var obj = common_functions["get_videotag_obj"](fakeresp);
if (!obj)
return done(null, false);

return done(fillobj_urls(obj, {
headers: {
Referer: fakeresp.finalUrl
}
}), 60*60);
}
});
if (newsrc) return newsrc;
}

if (domain_nosub === "tnaflix.com" || domain_nosub === "tnastatic.com" ||
domain_nosub === "empflix.com" || domain_nosub === "empstatic.com") {
var is_pagelink = true;
Expand Down Expand Up @@ -51705,6 +51771,22 @@ var $$IMU_EXPORT$$;
return obj;
}

if (domain === "cdn.aibooru.download") {
// thanks to anonymous for reporting:
// https://cdn.aibooru.download/180x180/ab/7f/ab7fa15dd719c9a5c91c2949a8a8e269.jpg
// https://cdn.aibooru.download/preview/ab/7f/ab7fa15dd719c9a5c91c2949a8a8e269.jpg
// https://cdn.aibooru.download/sample/ab/7f/__a__sample-ab7fa15dd719c9a5c91c2949a8a8e269.jpg
// https://cdn.aibooru.download/sample/ab/7f/__original_generated_by_ocean3__sample-ab7fa15dd719c9a5c91c2949a8a8e269.jpg
// https://cdn.aibooru.download/original/ab/7f/__original_generated_by_ocean3__ab7fa15dd719c9a5c91c2949a8a8e269.png
newsrc = src.replace(/(:\/\/[^/]+\/+)(?:preview|[0-9]+x[0-9]+)\/+((?:[a-f0-9]{2}\/+){2})/, "$1sample/$2__a__sample-")
if (newsrc !== src)
return newsrc;

newsrc = src.replace(/(:\/\/[^/]+\/+)sample\/+((?:[a-f0-9]{2}\/+){2}__[^/]+?__)sample-/, "$1original/$2");
if (newsrc !== src)
return add_extensions(newsrc);
}

if (domain === "cdn.donmai.us") {
// thanks to nadomodan on github: https://github.com/qsniyg/maxurl/issues/304
// https://cdn.donmai.us/preview/5e/c1/5ec172460e1f8cf0dff7219c2ba52f4c.jpg
Expand Down Expand Up @@ -90000,6 +90082,15 @@ var $$IMU_EXPORT$$;
if (newsrc) return newsrc;
}

if (host_domain_nowww === "redgifs.com" && options.element && !src) {
if (options.element.tagName === "VIDEO" && options.element.parentElement && options.element.parentElement.classList.contains("Video")) {
let poster = options.element.parentElement.querySelector("img.Video-Poster");
if (poster) {
return poster.src;
}
}
}

if (domain_nowww === "gifdeliverynetwork.com") {
return {
url: src.replace(/:\/\/[^/]+\/+/, "://redgifs.com/"),
Expand Down Expand Up @@ -109415,6 +109506,52 @@ var $$IMU_EXPORT$$;
}
}

if (domain_nowww === "cyberdrop.me") {
// thanks to anonymous for reporting:
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+f\/+([0-9a-zA-Z]+)(?:[?#].*)?$/,
query_for_id(id) {
let url = "https://" + domain + "/f/" + id;
return {
url: "https://" + domain + "/api/f/" + id,
imu_mode: "xhr",
headers: {
Accept: "application/json, text/plain, */*",
Referer: url
},
json: true
};
},
process(done, resp, cache_key) {
if (!resp.url) {
console_error(cache_key, "Unable to find URL from", resp);
return done(null, false);
}

let obj:BigImageInfoSObject = {
url: resp.url
};

if (resp.type && /^video\//.test(resp.type))
obj.video = true;

return done(obj, 50*60); // expires in 60 minutes
}
});
if (newsrc) return newsrc;
}

if (domain_nosub === "cyberdrop.cloud" && host_domain_nowww === "cyberdrop.me" && options.element) {
var link_el = common_functions["get_link_el_matching"](options.element.parentElement, el => el.href && /\/f\/+[a-zA-Z0-9]+$/.test(el.href));

if (link_el) {
return {
url: link_el.href,
is_pagelink: true
};
}
}

if (domain_nowww === "webm.red") {
// https://webm.red/thumb/uTXw.jpg
// https://webm.red/uTXw.webm
Expand Down Expand Up @@ -113349,6 +113486,24 @@ var $$IMU_EXPORT$$;
return src.replace(/(\/static\/+)img\/+[^/]+\/+/, "$1original/");
}

if (domain_nowww === "cartier.jp") {
// thanks to anonymous for reporting:
// https://www.cartier.jp/content/dam/cartier_dam/catalogue_assets/manhattan-update/1-jewelry/clp/trinity/slide/slide_01_trinity_24_clp.jpg.scale.2560.high.jpg
// https://www.cartier.jp/content/dam/cartier_dam/catalogue_assets/manhattan-update/1-jewelry/clp/trinity/slide/slide_01_trinity_24_clp.jpg
return src.replace(/(\/content\/+dam\/+.*\.[a-z]+)\.scale\.[0-9]+\.[a-z]+\.[a-z]+(?:[?#].*)?$/, "$1");
}

if (domain === "storage.onecloudpro.com") {
// thanks to anonymous for reporting:
// https://docs.imagizer.com/
// https://storage.onecloudpro.com/gallerySettings/files/180f25b7-58d4-48e8-9717-da872c8fb81c.jpeg?dpr=1&format=jpeg&quality=80&sharp_amount=27&sharp_radius=2&w=2400&h=1260&crop=fit&upscale=false
// https://storage.onecloudpro.com/gallerySettings/files/180f25b7-58d4-48e8-9717-da872c8fb81c.jpeg
return {
url: src.replace(/\?.*/, ""),
can_head: false
};
}




Expand Down Expand Up @@ -114037,7 +114192,7 @@ var $$IMU_EXPORT$$;
return decodeURIComponent(src.replace(/.*\/imageproxy\/imageproxy\.php.*?[&?]img=([^&]*).*?$/, "$1"));
}

if (src.match(/\/dims[0-9]*\/.*?\/(?:(?:(?:thumbnail|resize)\/[0-9>%A-F]+[xX][0-9>%A-F]*[^/]*\/)|(?:crop\/[0-9]+[xX][0-9]+)).*?(?:\/https?:\/\/|\?url=https?%3A)/)) {
if (src.match(/\/dims[0-9]*\/.*?\/(?:(?:(?:thumbnail|resize)\/[0-9>%A-F]+[xX][0-9>%A-F!+]*[^/]*\/)|(?:crop\/[0-9]+[xX][0-9+]+)).*?(?:\/https?:\/\/|\?url=https?(?:%3A|:))/)) {
// https://www.usnews.com/dims4/USNEWS/b09d13c/2147483647/thumbnail/970x647/quality/85/?url=http%3A%2F%2Fmedia.beam.usnews.com%2Fd0%2F686a3b584a63500605362dd3a1da31%2Ftag%3Areuters.com%2C2018%3Anewsml_LYNXNPEE25072%3A12018-03-06T044537Z_1_LYNXNPEE25072_RTROPTP_3_THAILAND-POLITICS.JPG
// https://www.usnews.com/dims4/USNEWS/f128de1/2147483647/thumbnail/640x420/quality/85/?url=http%3A%2F%2Fmedia.beam.usnews.com%2Fbd%2F0cf00f10ccd3788e7b9a42f1717e9d%2Ftag%3Areuters.com%2C2018%3Anewsml_LYNXNPEE1R088%3A12018-02-28T035131Z_1_LYNXNPEE1R088_RTROPTP_3_NORTHKOREA-SOUTHKOREA.JPG
// https://assets.sourcemedia.com/dims4/default/80669dd/2147483647/thumbnail/1200x630%3E/quality/90/?url=https%3A%2F%2Fassets.sourcemedia.com%2Fd9%2Fdf%2Fdf39cfb641848cd34eb997e96dc1%2Ffp-hockey-thumbnail-3-7-18.jpg
Expand All @@ -114054,6 +114209,9 @@ var $$IMU_EXPORT$$;
// https://static.politico.com/85/d5/3ffa5d764ae681f97ad70be2eecc/171205-mag-taylor-swift-ap-2-1160.jpg
// https://static.politico.com/dims4/default/20a0af6/2147483647/resize/1920x/quality/90/?url=https%3A%2F%2Fstatic.politico.com%2Fb0%2F1e%2F5ea5a2df4d03aedee69906c04b64%2Fap21131551475985-1.jpg
// https://static.politico.com/b0/1e/5ea5a2df4d03aedee69906c04b64/ap21131551475985-1.jpg
// thanks to anonymous for reporting:
// https://ca-times.brightspotcdn.com/dims4/default/d52190d/2147483647/strip/true/crop/1600x900+0+0/resize/1200x675!/quality/75/?url=https://california-times-brightspot.s3.amazonaws.com/0d/64/57fe28ae4f0faac1a2549bb47809/957f288a34a2553c782902b890edd230.jpeg
// https://california-times-brightspot.s3.amazonaws.com/0d/64/57fe28ae4f0faac1a2549bb47809/957f288a34a2553c782902b890edd230.jpeg
//
// https://d33ljpvc0tflz5.cloudfront.net/dims3/MMH/thumbnail/620x392/quality/75/?url=https%3A%2F%2Fd26ua9paks4zq.cloudfront.net%2F68%2F8d%2F197eef2a45cb84795efda4607102%2Fendoscopy-738x399-s1-stk-119373043.jpg
// https://d26ua9paks4zq.cloudfront.net/68/8d/197eef2a45cb84795efda4607102/endoscopy-738x399-s1-stk-119373043.jpg
Expand Down
Loading

0 comments on commit 085b4f8

Please sign in to comment.