Skip to content

Commit

Permalink
Support rehost.diberie.com (fixes #1336)
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Jun 30, 2024
1 parent 1e8099b commit 78c4d74
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bugfixes:
* Fix browser download replacing current page on non-same-origin URLs
* Fix GM_download headers for Tampermonkey and Violentmonkey

Special thanks to fireattack, nimbuz, Froktime, fyhtma, SakalliTavernaci, TheLastZombie, oifj34f34f, Solus, sn3akyb3ar, n0stal6ic, nyahgust, vscum, TristanWasTaken, BlindWanda, SUPER7X, n0099, remlap, CetaceanNation, bsydow, tathastu871, roi, ItsProyal, lazybookwyrm, James Joint for their contributions and reports for this release
Special thanks to fireattack, nimbuz, Froktime, fyhtma, SakalliTavernaci, TheLastZombie, oifj34f34f, Solus, sn3akyb3ar, n0stal6ic, nyahgust, vscum, TristanWasTaken, BlindWanda, SUPER7X, n0099, remlap, CetaceanNation, bsydow, tathastu871, roi, ItsProyal, lazybookwyrm, James Joint, Machou for their contributions and reports for this release

---

Expand Down
49 changes: 44 additions & 5 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33057,15 +33057,15 @@ var $$IMU_EXPORT$$;
// https://www.otempo.com.br/adobe/dynamicmedia/deliver/dm-aid--33a460a9-9598-46e3-863d-b5afc96c0f78/cidades-pris-o-em-bh-1716939511.jpg?preferwebp=true&width=200&quality=90
// https://www.otempo.com.br/adobe/dynamicmedia/deliver/dm-aid--33a460a9-9598-46e3-863d-b5afc96c0f78/cidades-pris-o-em-bh-1716939511.jpg
(domain_nowww === "otempo.com.br" && /\/dynamicmedia\/+deliver\//.test(src)) ||
// thanks to roi:
// https://www.usnews.com/object/image/0000018d-cd8c-d59b-ad8d-eddecde50001/feb21-ukraine-01.jpg?update-time=1708550742040&size=responsiveGallery
(domain_nowww === "usnews.com" && /\/object\/+image\//.test(src)) ||
// thanks to Liz on discord:
// https://assetsio.gnwcdn.com/painted_world1.jpg?width=1200&height=1200&fit=bounds&quality=70&format=jpg&auto=webp
domain === "assetsio.gnwcdn.com" ||
// thanks to Liz on discord:
// https://www.azcentral.com/gcdn/presto/2023/06/05/PPHX/d14cdd74-f08e-4aeb-8698-d8a1d856cba4-20230604161124_-_FFusion.jpg?width=1320&height=880&fit=crop&format=pjpg&auto=webp
(domain_nowww === "azcentral.com" && /\/gcdn\//.test(src)) ||
// thanks to James Joint on discord:
// https://images.kerrangcdn.com/images/2023/05/NessaBarrett-JamieLeeTaete-2023-9.jpg?auto=compress&fit=max&w=640
domain === "images.kerrangcdn.com" ||
// 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 @@ -37276,14 +37276,16 @@ var $$IMU_EXPORT$$;
// https://cdn-elle.ladmedia.fr/var/plain_site/storage/images/loisirs/musique/news/selena-gomez-pourquoi-pose-t-elle-presque-nue-2982877/56148853-1-fre-FR/Selena-Gomez-pourquoi-pose-t-elle-presque-nue.png
// https://resize-parismatch.lanmedia.fr/r/620,/img/var/news/storage/images/media/images/capture-d-e-cran-2015-02-06-a-11-46-142/7312692-1-fre-FR/Capture-d-e-cran-2015-02-06-a-11.46.14_original_backup.png
// https://cdn-parismatch.lanmedia.fr/var/news/storage/images/media/images/capture-d-e-cran-2015-02-06-a-11-46-142/7312692-1-fre-FR/Capture-d-e-cran-2015-02-06-a-11.46.14.png
// https://resize-elle.ladmedia.fr/rcrop/638,,forcex/img/var/plain_site/storage/images/site/cannes/star-du-jour/soiree-des-trophees-chopard-2009/vahina-giocante/11296447-1-fre-FR/vahina_giocante.jpg
// https://cdn-elle.ladmedia.fr/var/plain_site/storage/images/site/cannes/star-du-jour/soiree-des-trophees-chopard-2009/vahina-giocante/11296447-1-fre-FR/vahina_giocante.jpg
//
// https://cdn2-public.ladmedia.fr/var/public/storage/images/news/photos/photos-rihanna-elle-nous-refait-le-coup-de-la-robe-fendue-et-ultra-decolletee-197341/rihanna-a-la-soiree-stella-mccartney-hier-soir-a-londres-197343/1701021-1-fre-FR/Rihanna-a-la-soiree-Stella-McCartney-hier-soir-a-Londres_portrait_w674.jpg
// https://cdn2-public.ladmedia.fr/var/public/storage/images/news/photos/photos-rihanna-elle-nous-refait-le-coup-de-la-robe-fendue-et-ultra-decolletee-197341/rihanna-a-la-soiree-stella-mccartney-hier-soir-a-londres-197343/1701021-1-fre-FR/Rihanna-a-la-soiree-Stella-McCartney-hier-soir-a-Londres.jpg
return {
url: src
.replace(/\/(?:r|crop|rcrop)\/[^/]*\//, "/")
.replace(/:\/\/resize[0-9]*-([a-z]+[^/]*?)\/+img\/var\//, "://cdn-$1/var/")
.replace(/_[a-z0-9_]+(\.[^/.]*)$/, "$1"),
.replace(/\/(?:r|crop|rcrop)\/[^/]*\//, "/")
.replace(/_(?:original|portrait)_[a-z0-9_]+(\.[^/.]*)$/, "$1"),
can_head: true
};
}
Expand Down Expand Up @@ -114780,6 +114782,43 @@ var $$IMU_EXPORT$$;
return src.replace(/\/mediacache\/+photo\/+(uploads\/.*?)_thumb\./, "/$1.");
}

if (domain_nowww === "usnews.com" && /\/object\/+image\//.test(src)) {
obj = {
url: src,
can_head: false
};

// thanks to roi:
// https://www.usnews.com/object/image/0000018d-cd8c-d59b-ad8d-eddecde50001/feb21-ukraine-01.jpg?update-time=1708550742040&size=responsiveGallery
// https://www.usnews.com/object/image/0000018d-cd8c-d59b-ad8d-eddecde50001/feb21-ukraine-01.jpg
newsrc = src.replace(/\?.*$/, "");
if (newsrc !== src) {
obj.url = newsrc;
return obj;
}

// thanks to Liz on discord:
// https://www.usnews.com/object/image/0000015a-1a11-d479-a9df-9b35f2580000/bs17-michigan-crop-editorial.jpg?update-time=1487082026880&size=responsiveGallery
// https://www.usnews.com/object/image/0000015a-1a11-d479-a9df-9b35f2580000/bs17-michigan.jpg
// https://www.usnews.com/object/image/0000015a-19ff-d479-a9df-99ff4ea90000/bs17-alabama-crop.jpg?update-time=1487082241162&size=responsiveGallery
// https://www.usnews.com/object/image/0000015a-19ff-d479-a9df-99ff4ea90000/bs17-alabama.jpg
newsrc = src.replace(/-crop(?:-editorial)?(\.[a-z]+)$/, "$1");
if (newsrc !== src) {
obj.url = newsrc;
return obj;
}

return obj;
}

if (domain === "rehost.diberie.com") {
// thanks to Machou on github: https://github.com/qsniyg/maxurl/pull/1336
// https://rehost.diberie.com/Picture/Get/t/293961
// https://rehost.diberie.com/Picture/Get/m/293961
// https://rehost.diberie.com/Picture/Get/f/293961 -- 4178x2350
return src.replace(/(\/Picture\/+Get\/+)[tm]\/+/, "$1f/");
}




Expand Down
44 changes: 39 additions & 5 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -30213,15 +30213,15 @@ var $$IMU_EXPORT$$;
// https://www.otempo.com.br/adobe/dynamicmedia/deliver/dm-aid--33a460a9-9598-46e3-863d-b5afc96c0f78/cidades-pris-o-em-bh-1716939511.jpg?preferwebp=true&width=200&quality=90
// https://www.otempo.com.br/adobe/dynamicmedia/deliver/dm-aid--33a460a9-9598-46e3-863d-b5afc96c0f78/cidades-pris-o-em-bh-1716939511.jpg
(domain_nowww === "otempo.com.br" && /\/dynamicmedia\/+deliver\//.test(src)) ||
// thanks to roi:
// https://www.usnews.com/object/image/0000018d-cd8c-d59b-ad8d-eddecde50001/feb21-ukraine-01.jpg?update-time=1708550742040&size=responsiveGallery
(domain_nowww === "usnews.com" && /\/object\/+image\//.test(src)) ||
// thanks to Liz on discord:
// https://assetsio.gnwcdn.com/painted_world1.jpg?width=1200&height=1200&fit=bounds&quality=70&format=jpg&auto=webp
domain === "assetsio.gnwcdn.com" ||
// thanks to Liz on discord:
// https://www.azcentral.com/gcdn/presto/2023/06/05/PPHX/d14cdd74-f08e-4aeb-8698-d8a1d856cba4-20230604161124_-_FFusion.jpg?width=1320&height=880&fit=crop&format=pjpg&auto=webp
(domain_nowww === "azcentral.com" && /\/gcdn\//.test(src)) ||
// thanks to James Joint on discord:
// https://images.kerrangcdn.com/images/2023/05/NessaBarrett-JamieLeeTaete-2023-9.jpg?auto=compress&fit=max&w=640
domain === "images.kerrangcdn.com" ||
// 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 @@ -34099,14 +34099,16 @@ var $$IMU_EXPORT$$;
// https://cdn-elle.ladmedia.fr/var/plain_site/storage/images/loisirs/musique/news/selena-gomez-pourquoi-pose-t-elle-presque-nue-2982877/56148853-1-fre-FR/Selena-Gomez-pourquoi-pose-t-elle-presque-nue.png
// https://resize-parismatch.lanmedia.fr/r/620,/img/var/news/storage/images/media/images/capture-d-e-cran-2015-02-06-a-11-46-142/7312692-1-fre-FR/Capture-d-e-cran-2015-02-06-a-11.46.14_original_backup.png
// https://cdn-parismatch.lanmedia.fr/var/news/storage/images/media/images/capture-d-e-cran-2015-02-06-a-11-46-142/7312692-1-fre-FR/Capture-d-e-cran-2015-02-06-a-11.46.14.png
// https://resize-elle.ladmedia.fr/rcrop/638,,forcex/img/var/plain_site/storage/images/site/cannes/star-du-jour/soiree-des-trophees-chopard-2009/vahina-giocante/11296447-1-fre-FR/vahina_giocante.jpg
// https://cdn-elle.ladmedia.fr/var/plain_site/storage/images/site/cannes/star-du-jour/soiree-des-trophees-chopard-2009/vahina-giocante/11296447-1-fre-FR/vahina_giocante.jpg
//
// https://cdn2-public.ladmedia.fr/var/public/storage/images/news/photos/photos-rihanna-elle-nous-refait-le-coup-de-la-robe-fendue-et-ultra-decolletee-197341/rihanna-a-la-soiree-stella-mccartney-hier-soir-a-londres-197343/1701021-1-fre-FR/Rihanna-a-la-soiree-Stella-McCartney-hier-soir-a-Londres_portrait_w674.jpg
// https://cdn2-public.ladmedia.fr/var/public/storage/images/news/photos/photos-rihanna-elle-nous-refait-le-coup-de-la-robe-fendue-et-ultra-decolletee-197341/rihanna-a-la-soiree-stella-mccartney-hier-soir-a-londres-197343/1701021-1-fre-FR/Rihanna-a-la-soiree-Stella-McCartney-hier-soir-a-Londres.jpg
return {
url: src
.replace(/\/(?:r|crop|rcrop)\/[^/]*\//, "/")
.replace(/:\/\/resize[0-9]*-([a-z]+[^/]*?)\/+img\/var\//, "://cdn-$1/var/")
.replace(/_[a-z0-9_]+(\.[^/.]*)$/, "$1"),
.replace(/\/(?:r|crop|rcrop)\/[^/]*\//, "/")
.replace(/_(?:original|portrait)_[a-z0-9_]+(\.[^/.]*)$/, "$1"),
can_head: true
};
}
Expand Down Expand Up @@ -103065,6 +103067,38 @@ var $$IMU_EXPORT$$;
// https://cdn.directvelo.com/uploads/media/photos/6653917c8ad56.JPG
return src.replace(/\/mediacache\/+photo\/+(uploads\/.*?)_thumb\./, "/$1.");
}
if (domain_nowww === "usnews.com" && /\/object\/+image\//.test(src)) {
obj = {
url: src,
can_head: false
};
// thanks to roi:
// https://www.usnews.com/object/image/0000018d-cd8c-d59b-ad8d-eddecde50001/feb21-ukraine-01.jpg?update-time=1708550742040&size=responsiveGallery
// https://www.usnews.com/object/image/0000018d-cd8c-d59b-ad8d-eddecde50001/feb21-ukraine-01.jpg
newsrc = src.replace(/\?.*$/, "");
if (newsrc !== src) {
obj.url = newsrc;
return obj;
}
// thanks to Liz on discord:
// https://www.usnews.com/object/image/0000015a-1a11-d479-a9df-9b35f2580000/bs17-michigan-crop-editorial.jpg?update-time=1487082026880&size=responsiveGallery
// https://www.usnews.com/object/image/0000015a-1a11-d479-a9df-9b35f2580000/bs17-michigan.jpg
// https://www.usnews.com/object/image/0000015a-19ff-d479-a9df-99ff4ea90000/bs17-alabama-crop.jpg?update-time=1487082241162&size=responsiveGallery
// https://www.usnews.com/object/image/0000015a-19ff-d479-a9df-99ff4ea90000/bs17-alabama.jpg
newsrc = src.replace(/-crop(?:-editorial)?(\.[a-z]+)$/, "$1");
if (newsrc !== src) {
obj.url = newsrc;
return obj;
}
return obj;
}
if (domain === "rehost.diberie.com") {
// thanks to Machou on github: https://github.com/qsniyg/maxurl/pull/1336
// https://rehost.diberie.com/Picture/Get/t/293961
// https://rehost.diberie.com/Picture/Get/m/293961
// https://rehost.diberie.com/Picture/Get/f/293961 -- 4178x2350
return src.replace(/(\/Picture\/+Get\/+)[tm]\/+/, "$1f/");
}
// -- 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 78c4d74

Please sign in to comment.