From fd02e14ca98bacfd108b2d8112ca0058261a4601 Mon Sep 17 00:00:00 2001 From: qsniyg Date: Thu, 15 Feb 2024 12:51:17 +0000 Subject: [PATCH] More websites/rules --- src/userscript.ts | 15 +++++++++++++++ userscript.user.js | 13 +++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/userscript.ts b/src/userscript.ts index b538b563..588550c7 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -112320,6 +112320,21 @@ var $$IMU_EXPORT$$; return src.replace(/(\/photo\/+media\/+galleries\/+[^/]+\/+[^/]+\/+)normal\/+/, "$1big/"); } + if (domain_nowww === "caps-a-holic.com") { + // thanks to nimbuz on discord for reporting: + // https://caps-a-holic.com/c_image.php?max_height=1080&s=89274&a=1&x=451&y=176&l=0 + // https://caps-a-holic.com/c_image.php?max_height=2160&s=89274&a=0&x=0&y=0&l=1 + // l = lossless + // a = crop + if (/\/c_image\.php\?/.test(src)) { + newsrc = keep_queries(src, ["max_height", "s"]) + "&a=0&x=0&y=0&l=1"; + if (newsrc !== src) + return newsrc; + + return newsrc.replace(/([?&]max_height=)[0-9]+/, "$12160"); + } + } + diff --git a/userscript.user.js b/userscript.user.js index a0088118..d888a3ef 100644 --- a/userscript.user.js +++ b/userscript.user.js @@ -100819,6 +100819,19 @@ var $$IMU_EXPORT$$; // https://www.tulup.ru/photo/media/galleries/2017-01-28.universiade/3_feb_men_training/big/DSC04235.JPG -- 404 return src.replace(/(\/photo\/+media\/+galleries\/+[^/]+\/+[^/]+\/+)normal\/+/, "$1big/"); } + if (domain_nowww === "caps-a-holic.com") { + // thanks to nimbuz on discord for reporting: + // https://caps-a-holic.com/c_image.php?max_height=1080&s=89274&a=1&x=451&y=176&l=0 + // https://caps-a-holic.com/c_image.php?max_height=2160&s=89274&a=0&x=0&y=0&l=1 + // l = lossless + // a = crop + if (/\/c_image\.php\?/.test(src)) { + newsrc = keep_queries(src, ["max_height", "s"]) + "&a=0&x=0&y=0&l=1"; + if (newsrc !== src) + return newsrc; + return newsrc.replace(/([?&]max_height=)[0-9]+/, "$12160"); + } + } // -- 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