From 960ee8fb8d9ded44b0f70b0bb06579f8c36e4fe3 Mon Sep 17 00:00:00 2001 From: qsniyg Date: Tue, 23 Apr 2024 06:12:53 +0000 Subject: [PATCH] Improve mediadelivery.fi rule (fixes #270) --- src/userscript.ts | 6 ++++++ userscript.user.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/userscript.ts b/src/userscript.ts index 59374f34..75ae123e 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -92996,6 +92996,9 @@ var $$IMU_EXPORT$$; if (domain === "hs.mediadelivery.fi" || // https://is.mediadelivery.fi/img/658/0fc78cb8a1474ec2b20d891a8e033b37.jpg + // thanks to fyhtma on github: https://github.com/qsniyg/maxurl/issues/270 + // https://is.mediadelivery.fi/img/1920/0fc78cb8a1474ec2b20d891a8e033b37.jpg.webp + // https://is.mediadelivery.fi/img/1920/0fc78cb8a1474ec2b20d891a8e033b37.jpg domain === "is.mediadelivery.fi") { // thanks to thomas-ed on github: https://github.com/qsniyg/maxurl/issues/270 // https://www.hs.fi/talous/art-2000006442426.html @@ -93009,6 +93012,9 @@ var $$IMU_EXPORT$$; // https://hs.mediadelivery.fi/img/square/1440/d279bcab15194b45b4654246d69adb25.jpg.webp // https://hs.mediadelivery.fi/img/square/1920/d279bcab15194b45b4654246d69adb25.jpg.webp newsrc = src.replace(/(\/img\/+(?:square\/+)?)(?:[0-9]{3}|1[0-8][0-9]{2})\//, "$11920/"); + if (newsrc === src) { + newsrc = src.replace(/(\.[a-z]+)\.webp(?:[?#].*)?$/, "$1"); + } if (newsrc !== src) { return { url: newsrc, diff --git a/userscript.user.js b/userscript.user.js index 522b4720..f75610c1 100644 --- a/userscript.user.js +++ b/userscript.user.js @@ -83614,6 +83614,9 @@ var $$IMU_EXPORT$$; } if (domain === "hs.mediadelivery.fi" || // https://is.mediadelivery.fi/img/658/0fc78cb8a1474ec2b20d891a8e033b37.jpg + // thanks to fyhtma on github: https://github.com/qsniyg/maxurl/issues/270 + // https://is.mediadelivery.fi/img/1920/0fc78cb8a1474ec2b20d891a8e033b37.jpg.webp + // https://is.mediadelivery.fi/img/1920/0fc78cb8a1474ec2b20d891a8e033b37.jpg domain === "is.mediadelivery.fi") { // thanks to thomas-ed on github: https://github.com/qsniyg/maxurl/issues/270 // https://www.hs.fi/talous/art-2000006442426.html @@ -83627,6 +83630,9 @@ var $$IMU_EXPORT$$; // https://hs.mediadelivery.fi/img/square/1440/d279bcab15194b45b4654246d69adb25.jpg.webp // https://hs.mediadelivery.fi/img/square/1920/d279bcab15194b45b4654246d69adb25.jpg.webp newsrc = src.replace(/(\/img\/+(?:square\/+)?)(?:[0-9]{3}|1[0-8][0-9]{2})\//, "$11920/"); + if (newsrc === src) { + newsrc = src.replace(/(\.[a-z]+)\.webp(?:[?#].*)?$/, "$1"); + } if (newsrc !== src) { return { url: newsrc,