Skip to content

Commit

Permalink
Improve pmdstatic rule (fixes #1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Apr 5, 2024
1 parent 029b1bf commit 23dc810
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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

---

Expand Down
13 changes: 12 additions & 1 deletion src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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$/)) {
Expand All @@ -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") {
Expand Down
12 changes: 11 additions & 1 deletion userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -28690,14 +28690,24 @@ 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
// https://photo.gala.fr/upload/slideshow/quels-parrains-pour-les-revelations-cesar-les-photos-de-la-soiree-chanel-au-petit-palais-27606/solene-rigot-chien-et-son-parrain-samuel-benchetrit-475504.jpg
// 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:
Expand Down

0 comments on commit 23dc810

Please sign in to comment.