Skip to content

Commit

Permalink
Improve Spotify generic rule (fixes #1268)
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Jan 31, 2024
1 parent ce4c471 commit 8045313
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 2 deletions.
57 changes: 56 additions & 1 deletion src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32649,6 +32649,9 @@ var $$IMU_EXPORT$$;
domain === "eh96lnrmau.user-space.cdn.idcfcloud.net" ||
// https://www.lego.com/cdn/cs/set/assets/blt94d6ae80cbfd9f54/01_Tall_10307_Desktop.jpg?fit=crop&format=webply&quality=80&width=1600&height=700&dpr=1
(domain_nowww === "lego.com" && /\/cdn\/+.*\/assets\//.test(src)) ||
// thanks to anonymous for reporting:
// https://images.delfi.ee/media-api-image-cropper/v1/aa38a240-b907-11eb-922a-c7bedcd3f781.jpg?w=1600&h=914&noup=1
(domain === "images.delfi.ee" && /\/media-api-image-cropper\//.test(src)) ||
// http://us.jimmychoo.com/dw/image/v2/AAWE_PRD/on/demandware.static/-/Sites-jch-master-product-catalog/default/dw70b1ebd2/images/rollover/LIZ100MPY_120004_MODEL.jpg?sw=245&sh=245&sm=fit
// https://www.aritzia.com/on/demandware.static/-/Library-Sites-Aritzia_Shared/default/dw3a7fef87/seasonal/ss18/ss18-springsummercampaign/ss18-springsummercampaign-homepage/hptiles/tile-wilfred-lrg.jpg
src.match(/\/demandware\.static\//) ||
Expand Down Expand Up @@ -38180,10 +38183,14 @@ var $$IMU_EXPORT$$;
// https://deltagoodrem.com/cdn/shop/files/large.T95JuiIkD8uYxlRIpRCfgQnCh0amkV9xVTg8fLiqK9o_1920x.jpg?v=1689099080
// https://deltagoodrem.com/cdn/shop/files/large.T95JuiIkD8uYxlRIpRCfgQnCh0amkV9xVTg8fLiqK9o.jpg?v=1689099080
domain_nowww === "deltagoodrem.com" ||
// thanks to karpuzikov on github: https://github.com/qsniyg/maxurl/issues/1268
// https://partners.spigen.com/cdn/shop/products/title_ipad_pro_11_2020_rugged_armor_pro_02_175x.progressive.jpg?v=1659056452
// https://partners.spigen.com/cdn/shop/products/title_ipad_pro_11_2020_rugged_armor_pro_02.jpg?v=1659056452
domain === "partners.spigen.com" ||
// thanks to jonestly on discord:
// https://www.roguewavecoffee.ca/cdn/shop/products/zp6dark_532x532.png?v=1670808549
domain_nowww === "roguewavecoffee.ca") && /\/cdn\/+shop\//.test(src)) ||
/^[a-z]+:\/\/[^/]+\/+cdn\/+shop\/+(?:products|collections|files)\/+[^/.?#]+\.[a-zA-Z]+(?:[?#].*)?$/.test(src)) {
/^[a-z]+:\/\/[^/]+\/+cdn\/+shop\/+(?:products|collections|files)\/+[^/.?#]+(?:\.progressive)?\.[a-zA-Z]+(?:[?#].*)?$/.test(src)) {
// https://cdn.shopify.com/s/files/1/0086/0969/3776/t/56/assets/product-highlight-color-hover.svg
if (/\/assets\/+product-highlight-color-hover\.svg(?:[?#].*)?$/.test(src)) {
return {
Expand Down Expand Up @@ -38413,6 +38420,7 @@ var $$IMU_EXPORT$$;
// https://static01.nyt.com/images/2010/06/03/garden/03qanda-2/03qanda-2-popup.jpg -- 3744x5616
// thanks to anonymous for reporting:
// https://s1.nyt.com/timesmachine/pages/1/1977/07/31/92266267_360W.png?quality=75&auto=webp&disable=upscale
// https://static01.nyt.com/images/2023/03/19/multimedia/15NASA-STYLE-01-mcqv/15NASA-STYLE-01-mcqv-videoSixteenByNine3000.jpg -- 3000x1687
//
// doesn't work:
// https://static01.nyt.com/images/2010/10/24/arts/RICHARDS-Jp-1/RICHARDS-Jp-1-popup.jpg
Expand Down Expand Up @@ -80540,6 +80548,13 @@ var $$IMU_EXPORT$$;
return src.replace(/\/(?:width|height)\/+[0-9]+_[0-9a-f]+\/+tass\/+/, "/tass/");
}

if (domain_nosub === "cdnvideo.ru" && /^img[0-9]*tv\./.test(domain)) {
// thanks to anonymous for reporting:
// https://img5tv.cdnvideo.ru/webp/shared/files/202310/1_1821873.jpg
// https://img5tv.cdnvideo.ru/shared/files/202310/1_1821873.jpg
return src.replace(/\/webp\/+shared\//, "/shared/");
}

if (domain_nowww === "duonao.tv") {
// http://www.duonao.tv/upload/adult/201705292015391522730s.jpg
// http://www.duonao.tv/upload/adult/201705292015391522730.jpg
Expand Down Expand Up @@ -111637,6 +111652,46 @@ var $$IMU_EXPORT$$;
};
}

if (domain_nowww === "pastvu.com") {
// thanks to anonymous for reporting:
// https://pastvu.com/_p/x/e/b/9/eb99h08uv9jmffmfad.jpg
// https://pastvu.com/_p/a/e/b/9/eb99h08uv9jmffmfad.jpg -- 2303x1565
// a, d, h, m, q, s, x
return src.replace(/(:\/\/[^/]+\/+_p\/+)[a-z]\/+/, "$1a/");
}

if (domain === "img.fotokonkurs.ru") {
// thanks to anonymous for reporting:
// https://img.fotokonkurs.ru/cache/photo_500w/photos/2024/01/9/b316d0304772beb6c559e96dff67669d/5033161e769b698ef545350f4f9c9097.jpeg
// https://img.fotokonkurs.ru/cache/original/photos/2024/01/9/b316d0304772beb6c559e96dff67669d/5033161e769b698ef545350f4f9c9097.jpeg
return src.replace(/(\/cache\/+)[^/]+\/+(photos\/+)/, "$1original/$2");
}

if (domain === "img.championat.com") {
// thanks to anonymous for reporting:
// https://img.championat.com/s/735x490/news/big/b/b/anna-pogorilaja_14602722361049245269.jpg
// https://img.championat.com/news/big/b/b/anna-pogorilaja_14602722361049245269.jpg
// https://img.championat.com/c/1200x900/news/big/y/r/anna-pogorilaja-samaja-gorjachaja-figuristka-rossii_16035392891022242366.jpg
// https://img.championat.com/news/big/y/r/anna-pogorilaja-samaja-gorjachaja-figuristka-rossii_16035392891022242366.jpg
return src.replace(/\/[sc]\/+[0-9]+x[0-9]+\/+/, "/");
}

if (domain === "img.dni.ru") {
// thanks to anonymous for reporting:
// https://img.dni.ru/binaries/v3_main/528013.jpg -- 685x400
// https://img.dni.ru/binaries/social/528013.jpg -- 1370x799
// other:
// https://img.dni.ru/files/orig/n/d/9/nd9l5ri7t3w2buo.jpg
return src.replace(/(\/binaries\/+)v3_main\//, "$1social/");
}

if (domain_nowww === "mylittlewallpaper.com") {
// thanks to anonymous for reporting:
// https://www.mylittlewallpaper.com/images/r2_657b378964b445.18663503.jpg
// https://www.mylittlewallpaper.com/images/o_657b378964b445.18663503.jpg
return src.replace(/(\/images\/+)r[0-9]+_/, "$1o_");
}




Expand Down
51 changes: 50 additions & 1 deletion userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -29836,6 +29836,9 @@ var $$IMU_EXPORT$$;
domain === "eh96lnrmau.user-space.cdn.idcfcloud.net" ||
// https://www.lego.com/cdn/cs/set/assets/blt94d6ae80cbfd9f54/01_Tall_10307_Desktop.jpg?fit=crop&format=webply&quality=80&width=1600&height=700&dpr=1
(domain_nowww === "lego.com" && /\/cdn\/+.*\/assets\//.test(src)) ||
// thanks to anonymous for reporting:
// https://images.delfi.ee/media-api-image-cropper/v1/aa38a240-b907-11eb-922a-c7bedcd3f781.jpg?w=1600&h=914&noup=1
(domain === "images.delfi.ee" && /\/media-api-image-cropper\//.test(src)) ||
// http://us.jimmychoo.com/dw/image/v2/AAWE_PRD/on/demandware.static/-/Sites-jch-master-product-catalog/default/dw70b1ebd2/images/rollover/LIZ100MPY_120004_MODEL.jpg?sw=245&sh=245&sm=fit
// https://www.aritzia.com/on/demandware.static/-/Library-Sites-Aritzia_Shared/default/dw3a7fef87/seasonal/ss18/ss18-springsummercampaign/ss18-springsummercampaign-homepage/hptiles/tile-wilfred-lrg.jpg
src.match(/\/demandware\.static\//) ||
Expand Down Expand Up @@ -34918,10 +34921,14 @@ var $$IMU_EXPORT$$;
// https://deltagoodrem.com/cdn/shop/files/large.T95JuiIkD8uYxlRIpRCfgQnCh0amkV9xVTg8fLiqK9o_1920x.jpg?v=1689099080
// https://deltagoodrem.com/cdn/shop/files/large.T95JuiIkD8uYxlRIpRCfgQnCh0amkV9xVTg8fLiqK9o.jpg?v=1689099080
domain_nowww === "deltagoodrem.com" ||
// thanks to karpuzikov on github: https://github.com/qsniyg/maxurl/issues/1268
// https://partners.spigen.com/cdn/shop/products/title_ipad_pro_11_2020_rugged_armor_pro_02_175x.progressive.jpg?v=1659056452
// https://partners.spigen.com/cdn/shop/products/title_ipad_pro_11_2020_rugged_armor_pro_02.jpg?v=1659056452
domain === "partners.spigen.com" ||
// thanks to jonestly on discord:
// https://www.roguewavecoffee.ca/cdn/shop/products/zp6dark_532x532.png?v=1670808549
domain_nowww === "roguewavecoffee.ca") && /\/cdn\/+shop\//.test(src)) ||
/^[a-z]+:\/\/[^/]+\/+cdn\/+shop\/+(?:products|collections|files)\/+[^/.?#]+\.[a-zA-Z]+(?:[?#].*)?$/.test(src)) {
/^[a-z]+:\/\/[^/]+\/+cdn\/+shop\/+(?:products|collections|files)\/+[^/.?#]+(?:\.progressive)?\.[a-zA-Z]+(?:[?#].*)?$/.test(src)) {
// https://cdn.shopify.com/s/files/1/0086/0969/3776/t/56/assets/product-highlight-color-hover.svg
if (/\/assets\/+product-highlight-color-hover\.svg(?:[?#].*)?$/.test(src)) {
return {
Expand Down Expand Up @@ -35143,6 +35150,7 @@ var $$IMU_EXPORT$$;
// https://static01.nyt.com/images/2010/06/03/garden/03qanda-2/03qanda-2-popup.jpg -- 3744x5616
// thanks to anonymous for reporting:
// https://s1.nyt.com/timesmachine/pages/1/1977/07/31/92266267_360W.png?quality=75&auto=webp&disable=upscale
// https://static01.nyt.com/images/2023/03/19/multimedia/15NASA-STYLE-01-mcqv/15NASA-STYLE-01-mcqv-videoSixteenByNine3000.jpg -- 3000x1687
//
// doesn't work:
// https://static01.nyt.com/images/2010/10/24/arts/RICHARDS-Jp-1/RICHARDS-Jp-1-popup.jpg
Expand Down Expand Up @@ -72624,6 +72632,12 @@ var $$IMU_EXPORT$$;
// https://phototass3.cdnvideo.ru/tass/m2/uploads/i/20190418/5020384.jpg
return src.replace(/\/(?:width|height)\/+[0-9]+_[0-9a-f]+\/+tass\/+/, "/tass/");
}
if (domain_nosub === "cdnvideo.ru" && /^img[0-9]*tv\./.test(domain)) {
// thanks to anonymous for reporting:
// https://img5tv.cdnvideo.ru/webp/shared/files/202310/1_1821873.jpg
// https://img5tv.cdnvideo.ru/shared/files/202310/1_1821873.jpg
return src.replace(/\/webp\/+shared\//, "/shared/");
}
if (domain_nowww === "duonao.tv") {
// http://www.duonao.tv/upload/adult/201705292015391522730s.jpg
// http://www.duonao.tv/upload/adult/201705292015391522730.jpg
Expand Down Expand Up @@ -100196,6 +100210,41 @@ var $$IMU_EXPORT$$;
can_head: false // 500
};
}
if (domain_nowww === "pastvu.com") {
// thanks to anonymous for reporting:
// https://pastvu.com/_p/x/e/b/9/eb99h08uv9jmffmfad.jpg
// https://pastvu.com/_p/a/e/b/9/eb99h08uv9jmffmfad.jpg -- 2303x1565
// a, d, h, m, q, s, x
return src.replace(/(:\/\/[^/]+\/+_p\/+)[a-z]\/+/, "$1a/");
}
if (domain === "img.fotokonkurs.ru") {
// thanks to anonymous for reporting:
// https://img.fotokonkurs.ru/cache/photo_500w/photos/2024/01/9/b316d0304772beb6c559e96dff67669d/5033161e769b698ef545350f4f9c9097.jpeg
// https://img.fotokonkurs.ru/cache/original/photos/2024/01/9/b316d0304772beb6c559e96dff67669d/5033161e769b698ef545350f4f9c9097.jpeg
return src.replace(/(\/cache\/+)[^/]+\/+(photos\/+)/, "$1original/$2");
}
if (domain === "img.championat.com") {
// thanks to anonymous for reporting:
// https://img.championat.com/s/735x490/news/big/b/b/anna-pogorilaja_14602722361049245269.jpg
// https://img.championat.com/news/big/b/b/anna-pogorilaja_14602722361049245269.jpg
// https://img.championat.com/c/1200x900/news/big/y/r/anna-pogorilaja-samaja-gorjachaja-figuristka-rossii_16035392891022242366.jpg
// https://img.championat.com/news/big/y/r/anna-pogorilaja-samaja-gorjachaja-figuristka-rossii_16035392891022242366.jpg
return src.replace(/\/[sc]\/+[0-9]+x[0-9]+\/+/, "/");
}
if (domain === "img.dni.ru") {
// thanks to anonymous for reporting:
// https://img.dni.ru/binaries/v3_main/528013.jpg -- 685x400
// https://img.dni.ru/binaries/social/528013.jpg -- 1370x799
// other:
// https://img.dni.ru/files/orig/n/d/9/nd9l5ri7t3w2buo.jpg
return src.replace(/(\/binaries\/+)v3_main\//, "$1social/");
}
if (domain_nowww === "mylittlewallpaper.com") {
// thanks to anonymous for reporting:
// https://www.mylittlewallpaper.com/images/r2_657b378964b445.18663503.jpg
// https://www.mylittlewallpaper.com/images/o_657b378964b445.18663503.jpg
return src.replace(/(\/images\/+)r[0-9]+_/, "$1o_");
}
// -- 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 8045313

Please sign in to comment.