From 23dc81032241d47afdafad190c2ecf94bd6a5805 Mon Sep 17 00:00:00 2001 From: qsniyg Date: Fri, 5 Apr 2024 18:09:45 +0000 Subject: [PATCH] Improve pmdstatic rule (fixes #1310) --- CHANGELOG.txt | 4 ++-- src/userscript.ts | 13 ++++++++++++- userscript.user.js | 12 +++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b6111488..09bc7814 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,6 @@ -2023.3.1 (in-dev) +2023.4.0 (in-dev) -Special thanks to fireattack, nimbuz, Froktime, fyhtma, SakalliTavernaci, TheLastZombie, oifj34f34f, Solus for their contributions and reports for this release +Special thanks to fireattack, nimbuz, Froktime, fyhtma, SakalliTavernaci, TheLastZombie, oifj34f34f, Solus, sn3akyb3ar for their contributions and reports for this release --- diff --git a/src/userscript.ts b/src/userscript.ts index 21796591..a703265c 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -31501,6 +31501,15 @@ var $$IMU_EXPORT$$; base = decodeURIComponent(base); return base; } + + // thanks to sn3akybear on github: https://github.com/qsniyg/maxurl/issues/1310 + // https://photo.voici.fr/adam-sandler-lenny-kravitz-billie-eilish-les-stars-presentes-aux-peoples-choice-awards-2024-59444 + // https://voi.img.pmdstatic.net/scale/~1~voi~2024~02~19~15af5e46-e0a6-4c83-a188-c42170541d61.jpeg/autox600/quality/65/crop-from/center/picture.jpeg + // https://i.pmdstatic.net/voi/2024/02/19/15af5e46-e0a6-4c83-a188-c42170541d61.jpeg + match = src.match(/^[a-z]+:\/\/[^/]+\/+[a-z]+\/+~1~(voi)~([0-9]{4})~([0-9]{2})~([0-9]{2})~([-0-9a-f]+\.[a-z]+)\//); + if (match) { + return "https://i.pmdstatic.net/" + match[1] + "/" + match[2] + "/" + match[3] + "/" + match[4] + "/" + match[5]; + } } if (domain_nosub === "pmdstatic.net" && domain.match(/img\..*?pmdstatic\.net$/)) { @@ -31509,7 +31518,9 @@ var $$IMU_EXPORT$$; // http://gal.img.pmdstatic.net/fit/https.3A.2F.2Fi.2Eimgur.2Ecom.2FQK42KsW.2Ejpg/400x600/quality/65/test.jpg // https://i.imgur.com/QK42KsW.jpg // http://img.tra.pmdstatic.net/fit/http.3A.2F.2Fwww.2Efoodreporter.2Efr.2Fupload.2Foriginal.2F5.2Fc.2Fz.2F8.2Fu.2F1258707.2Ejpg/312x240/quality/100/picture.jpg - return decodeURIComponent(src.replace(/.*?\.pmdstatic\.net\/fit\/([^/]*).*/, "$1").replace(/\./g, "%")); + newsrc = src.replace(/.*?\.pmdstatic\.net\/fit\/([^/]*).*/, "$1").replace(/\./g, "%"); + if (newsrc !== src) + return decodeURIComponent(newsrc); } if (domain_nowww === "gala.fr") { diff --git a/userscript.user.js b/userscript.user.js index 1d9685b0..f605ae80 100644 --- a/userscript.user.js +++ b/userscript.user.js @@ -28690,6 +28690,14 @@ var $$IMU_EXPORT$$; base = decodeURIComponent(base); return base; } + // thanks to sn3akybear on github: https://github.com/qsniyg/maxurl/issues/1310 + // https://photo.voici.fr/adam-sandler-lenny-kravitz-billie-eilish-les-stars-presentes-aux-peoples-choice-awards-2024-59444 + // https://voi.img.pmdstatic.net/scale/~1~voi~2024~02~19~15af5e46-e0a6-4c83-a188-c42170541d61.jpeg/autox600/quality/65/crop-from/center/picture.jpeg + // https://i.pmdstatic.net/voi/2024/02/19/15af5e46-e0a6-4c83-a188-c42170541d61.jpeg + match = src.match(/^[a-z]+:\/\/[^/]+\/+[a-z]+\/+~1~(voi)~([0-9]{4})~([0-9]{2})~([0-9]{2})~([-0-9a-f]+\.[a-z]+)\//); + if (match) { + return "https://i.pmdstatic.net/" + match[1] + "/" + match[2] + "/" + match[3] + "/" + match[4] + "/" + match[5]; + } } if (domain_nosub === "pmdstatic.net" && domain.match(/img\..*?pmdstatic\.net$/)) { // https://gal.img.pmdstatic.net/fit/https.3A.2F.2Fphoto.2Egala.2Efr.2Fupload.2Fslideshow.2Fquels-parrains-pour-les-revelations-cesar-les-photos-de-la-soiree-chanel-au-petit-palais-27606.2Fsolene-rigot-chien-et-son-parrain-samuel-benchetrit-475504.2Ejpg/400x600/quality/65/solene-rigot-chien-et-son-parrain-samuel-benchetrit.jpg @@ -28697,7 +28705,9 @@ var $$IMU_EXPORT$$; // http://gal.img.pmdstatic.net/fit/https.3A.2F.2Fi.2Eimgur.2Ecom.2FQK42KsW.2Ejpg/400x600/quality/65/test.jpg // https://i.imgur.com/QK42KsW.jpg // http://img.tra.pmdstatic.net/fit/http.3A.2F.2Fwww.2Efoodreporter.2Efr.2Fupload.2Foriginal.2F5.2Fc.2Fz.2F8.2Fu.2F1258707.2Ejpg/312x240/quality/100/picture.jpg - return decodeURIComponent(src.replace(/.*?\.pmdstatic\.net\/fit\/([^/]*).*/, "$1").replace(/\./g, "%")); + newsrc = src.replace(/.*?\.pmdstatic\.net\/fit\/([^/]*).*/, "$1").replace(/\./g, "%"); + if (newsrc !== src) + return decodeURIComponent(newsrc); } if (domain_nowww === "gala.fr") { // thanks to anonymous for reporting: