From 3b9e30bdeeb4b99fec6f7562b04db01d3b14df19 Mon Sep 17 00:00:00 2001 From: qsniyg Date: Thu, 9 May 2024 17:43:43 +0000 Subject: [PATCH] More websites/rules Fixes #1323 --- CHANGELOG.txt | 2 +- src/userscript.ts | 37 ++++++++++++++++++++++++++++++++++--- userscript.user.js | 34 +++++++++++++++++++++++++++++++--- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7500df35..e9336912 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 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 for their contributions and reports for this release --- diff --git a/src/userscript.ts b/src/userscript.ts index 6d96cc21..3635fa40 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -29157,9 +29157,14 @@ var $$IMU_EXPORT$$; // http://media1.popsugar-assets.com/files/2016/05/22/156/n/1922398/c7b25a8fd8aaab98_GettyImages-533596620/i/Mila-Kunis-Ashton-Kutcher-Billboard-Music-Awards-2016.jpg // https://media1.popsugar-assets.com/files/thumbor/t85Z6EqhDjIu8EaEzfzk5hOJ1Ck/0x360:2400x2394/fit-in/728xorig/filters:format_auto-!!-:strip_icc-!!-:watermark-!popsugar-watermark.png,-5,-5,0!-/2020/01/16/687/n/1922564/4606d55d5e20819816a430.09594567_/i/selena-gomez-style-for-new-album-release-2020.jpg // https://media1.popsugar-assets.com/files/2020/01/16/687/n/1922564/4606d55d5e20819816a430.09594567_/i/selena-gomez-style-for-new-album-release-2020.jpg - newsrc = src.replace(/\/thumbor\/[^/]+\/(?:[0-9]+x[0-9]+:[0-9]+x[0-9]+\/)?(?:fit-in\/)?[^/]+\/(?:filters:[^/]+\/)?/, "/"); - if (newsrc !== src) - return newsrc; + // thanks to bsydow on github: https://github.com/qsniyg/maxurl/issues/1323 + // https://media1.popsugar-assets.com/files/thumbor/nABWpoAEkMbUUQ-0rBRznnHGnlQ=/fit-in/792x527/top/filters:format_auto():upscale()/2019/04/23/687/n/1922564/7aba47deaf9aef0f_GettyImages-1144527044.jpg + // https://media1.popsugar-assets.com/files/2019/04/23/687/n/1922564/7aba47deaf9aef0f_GettyImages-1144527044.jpg + if (string_indexof(src, "/thumbor/") >= 0) { + newsrc = src.replace(/\/thumbor\/.*/, "/" + common_functions["get_thumbor_url"](src.replace(/.*?\/thumbor\//, "/"))); + if (newsrc !== src) + return newsrc; + } // http://media1.popsugar-assets.com/files/2013/02/08/2/192/1922398/13bc50e021acd58e_wenn10840119.xxxlarge/i/Spring-Breakers-Berlin-Red-Carpet-Premiere-Pictures.jpg // http://media1.popsugar-assets.com/files/2013/02/08/2/192/1922398/13bc50e021acd58e_wenn10840119/i/Spring-Breakers-Berlin-Red-Carpet-Premiere-Pictures.jpg @@ -55102,6 +55107,15 @@ var $$IMU_EXPORT$$; if (domain_nosub === "smugmug.com" || domain === "photos.smugmug.com") { + // thanks to anonymous for reporting: + // https://[subdomain].smugmug.com/img/spacer.gif + if (/\/img\/+spacer\.gif(?:[?#].*)?$/.test(src)) { + return { + url: src, + bad: "mask" + }; + } + // thanks to /u/GarlicoinAccount on reddit for the example URLs and regex! // https://photos.smugmug.com/Portfolio/i-FsKpjtH/0/bc0067fc/L/Dubai%20at%20Dusk-L.jpg // https://photos.smugmug.com/Portfolio/i-FsKpjtH/0/bc0067fc/O/Dubai%20at%20Dusk-O.jpg @@ -73629,6 +73643,15 @@ var $$IMU_EXPORT$$; return newsrc; } + if (domain === "thumbs.onlyfans.com") { + // thanks to anonymous for reporting: + // https://thumbs.onlyfans.com/public/files/thumbs/c144/a/au/auh/auhfdjr84ievanykemqluqjnptunqcsh1705101851/208521709/avatar.jpg + // https://public.onlyfans.com/files/a/au/auh/auhfdjr84ievanykemqluqjnptunqcsh1705101851/208521709/avatar.jpg + newsrc = src.replace(/:\/\/[^/]+\/+public\/+files\/+thumbs\/+[wc][0-9]+\/+/, "://public.onlyfans.com/files/"); + if (newsrc !== src) + return newsrc; + } + if (host_domain_nosub === "onlyfans.com" && (domain_nosub === "onlyfans.com" || domain === "media.onlyfans.com" || @@ -113922,6 +113945,14 @@ var $$IMU_EXPORT$$; .replace(/\/resize\/+(.*?)_[0-9]+x[0-9]+(\.[a-z]+)(?:[?#].*)?$/, "/modpub/$1$2"); } + if (domain === "files.structurae.net") { + // thanks to anonymous for reporting: + // https://files.structurae.net/files/300x200/1/219-jauntal-2-2000.jpg + // https://files.structurae.net/files/350high/1/219-jauntal-2-2000.jpg + // https://files.structurae.net/files/photos/1/219-jauntal-2-2000.jpg + return src.replace(/(\/files\/+)[0-9]+(?:x[0-9]+|high)\/+/, "$1photos/"); + } + diff --git a/userscript.user.js b/userscript.user.js index 96111988..1b5cefc1 100644 --- a/userscript.user.js +++ b/userscript.user.js @@ -26603,9 +26603,14 @@ var $$IMU_EXPORT$$; // http://media1.popsugar-assets.com/files/2016/05/22/156/n/1922398/c7b25a8fd8aaab98_GettyImages-533596620/i/Mila-Kunis-Ashton-Kutcher-Billboard-Music-Awards-2016.jpg // https://media1.popsugar-assets.com/files/thumbor/t85Z6EqhDjIu8EaEzfzk5hOJ1Ck/0x360:2400x2394/fit-in/728xorig/filters:format_auto-!!-:strip_icc-!!-:watermark-!popsugar-watermark.png,-5,-5,0!-/2020/01/16/687/n/1922564/4606d55d5e20819816a430.09594567_/i/selena-gomez-style-for-new-album-release-2020.jpg // https://media1.popsugar-assets.com/files/2020/01/16/687/n/1922564/4606d55d5e20819816a430.09594567_/i/selena-gomez-style-for-new-album-release-2020.jpg - newsrc = src.replace(/\/thumbor\/[^/]+\/(?:[0-9]+x[0-9]+:[0-9]+x[0-9]+\/)?(?:fit-in\/)?[^/]+\/(?:filters:[^/]+\/)?/, "/"); - if (newsrc !== src) - return newsrc; + // thanks to bsydow on github: https://github.com/qsniyg/maxurl/issues/1323 + // https://media1.popsugar-assets.com/files/thumbor/nABWpoAEkMbUUQ-0rBRznnHGnlQ=/fit-in/792x527/top/filters:format_auto():upscale()/2019/04/23/687/n/1922564/7aba47deaf9aef0f_GettyImages-1144527044.jpg + // https://media1.popsugar-assets.com/files/2019/04/23/687/n/1922564/7aba47deaf9aef0f_GettyImages-1144527044.jpg + if (string_indexof(src, "/thumbor/") >= 0) { + newsrc = src.replace(/\/thumbor\/.*/, "/" + common_functions["get_thumbor_url"](src.replace(/.*?\/thumbor\//, "/"))); + if (newsrc !== src) + return newsrc; + } // http://media1.popsugar-assets.com/files/2013/02/08/2/192/1922398/13bc50e021acd58e_wenn10840119.xxxlarge/i/Spring-Breakers-Berlin-Red-Carpet-Premiere-Pictures.jpg // http://media1.popsugar-assets.com/files/2013/02/08/2/192/1922398/13bc50e021acd58e_wenn10840119/i/Spring-Breakers-Berlin-Red-Carpet-Premiere-Pictures.jpg // https://media1.popsugar-assets.com/files/2015/09/02/221/n/37139775/d391fe8f30364ef0_15._2007_GettyImages-81449203/i/Selena-Gomez.jpg @@ -50172,6 +50177,14 @@ var $$IMU_EXPORT$$; } if (domain_nosub === "smugmug.com" || domain === "photos.smugmug.com") { + // thanks to anonymous for reporting: + // https://[subdomain].smugmug.com/img/spacer.gif + if (/\/img\/+spacer\.gif(?:[?#].*)?$/.test(src)) { + return { + url: src, + bad: "mask" + }; + } // thanks to /u/GarlicoinAccount on reddit for the example URLs and regex! // https://photos.smugmug.com/Portfolio/i-FsKpjtH/0/bc0067fc/L/Dubai%20at%20Dusk-L.jpg // https://photos.smugmug.com/Portfolio/i-FsKpjtH/0/bc0067fc/O/Dubai%20at%20Dusk-O.jpg @@ -66653,6 +66666,14 @@ var $$IMU_EXPORT$$; if (newsrc !== src) return newsrc; } + if (domain === "thumbs.onlyfans.com") { + // thanks to anonymous for reporting: + // https://thumbs.onlyfans.com/public/files/thumbs/c144/a/au/auh/auhfdjr84ievanykemqluqjnptunqcsh1705101851/208521709/avatar.jpg + // https://public.onlyfans.com/files/a/au/auh/auhfdjr84ievanykemqluqjnptunqcsh1705101851/208521709/avatar.jpg + newsrc = src.replace(/:\/\/[^/]+\/+public\/+files\/+thumbs\/+[wc][0-9]+\/+/, "://public.onlyfans.com/files/"); + if (newsrc !== src) + return newsrc; + } if (host_domain_nosub === "onlyfans.com" && (domain_nosub === "onlyfans.com" || domain === "media.onlyfans.com" || @@ -102280,6 +102301,13 @@ var $$IMU_EXPORT$$; .replace(/(\/modpub\/.*)\.webp(?:[?#].*)?$/, "$1.jpg") .replace(/\/resize\/+(.*?)_[0-9]+x[0-9]+(\.[a-z]+)(?:[?#].*)?$/, "/modpub/$1$2"); } + if (domain === "files.structurae.net") { + // thanks to anonymous for reporting: + // https://files.structurae.net/files/300x200/1/219-jauntal-2-2000.jpg + // https://files.structurae.net/files/350high/1/219-jauntal-2-2000.jpg + // https://files.structurae.net/files/photos/1/219-jauntal-2-2000.jpg + return src.replace(/(\/files\/+)[0-9]+(?:x[0-9]+|high)\/+/, "$1photos/"); + } // -- 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