Skip to content

Commit

Permalink
More websites/rules (fixes #1267)
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Jan 30, 2024
1 parent d9c8b72 commit ce4c471
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Improvements:

* Various improvements/fixes to existing rules (including TikTok)

Special thanks to fireattack, aslian, remlap, uwuceo, TristanWasTaken for their contributions and reports for this release
Special thanks to fireattack, aslian, remlap, uwuceo, TristanWasTaken, Froktime for their contributions and reports for this release

---

Expand Down
58 changes: 58 additions & 0 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27246,6 +27246,18 @@ var $$IMU_EXPORT$$;
newsrc = src.replace(/^[a-z]+:\/\/thumb\.([^/]*)\/+([^/]*\/+)?[0-9]{2}\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{8,}_[0-9]+\.)/, "http://image.$1/$2$3");
if (newsrc !== src)
return newsrc;

// thanks to anonymous for reporting:
// https://thumb.mtstarnews.com/star_realdisp.php?ImageID=2017051015315128279_2.jpg
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+star_realdisp\.php\?(?:.*&)?ImageID=([0-9]+_[0-9]+\.[a-z]+)(?:[&#].*)?$/,
run: function(cb, match) {
let url = match[1];
let urlmatch = url.match(/^([0-9]{4})([0-9]{2})/);
cb("https://thumb.mtstarnews.com/06/" + urlmatch[1] + "/" + urlmatch[2] + "/" + url);
}
});
if (newsrc) return newsrc;
}

if (domain === "menu.mt.co.kr" ||
Expand Down Expand Up @@ -110412,6 +110424,10 @@ var $$IMU_EXPORT$$;
}

if (domain === "images.kinorium.com" ||
// thanks to anonymous for reporting:
// https://images-s.kinorium.com/movie/shot/90483/h280_902025.jpg
// https://images-s.kinorium.com/movie/shot/90483/original_902025.jpg
domain === "images-s.kinorium.com" ||
// https://en-images.kinorium.com/movie/1080/234571.jpg?1613719646
// https://en-images.kinorium.com/movie/original/234571.jpg?1613719646 -- 2764x4096
domain === "en-images.kinorium.com") {
Expand Down Expand Up @@ -111590,6 +111606,37 @@ var $$IMU_EXPORT$$;
return src.replace(/\/dims\/+[^?#]*([?#].*)?$/, "$1");
}

if (domain === "photos.eruce.com") {
// thanks to anonymous for reporting:
// https://photos.eruce.com/thumbs/1cd/295/d35/295/ec5/d35/6a3d0d460bb36567d2aab9d37391834a_500x500.webp
// https://photos.eruce.com/1cd/295/d35/295/ec5/d35/6a3d0d460bb36567d2aab9d37391834a.jpg
return src
.replace(/\/thumbs\/+(.*?)_[0-9]+x[0-9]+(\.jpg)(?:[?#].*)?$/, "/$1$2")
.replace(/\.webp(?:[?#].*)?$/, ".jpg");
}

if (domain === "img.rgstatic.com") {
// thanks to anonymous for reporting:
// https://img.rgstatic.com/content/movie/48e374b5-08ed-49bd-a920-71fd74a71f85/backdrop-1920.jpg
// https://img.rgstatic.com/content/movie/48e374b5-08ed-49bd-a920-71fd74a71f85/backdrop-original.jpg -- 2000x1125
// https://img.rgstatic.com/content/movie/fe1688d1-3d8f-493f-8ec4-8b5d28fe6e14/poster-780.jpg
// https://img.rgstatic.com/content/movie/fe1688d1-3d8f-493f-8ec4-8b5d28fe6e14/poster-original.jpg
return src.replace(/(\/content\/+[^/]+\/+[-0-9a-f]{10,}\/+[^/?#.]+-)[0-9]+\./, "$1original.");
}

if (domain === "an.arbum.art") {
// thanks to Froktime on github: https://github.com/qsniyg/maxurl/issues/1267
// https://an.arbum.art/i/[guid].png?preset=ArtworkPreview&size=200&ratio=1
// https://an.arbum.art/i/[guid].png
return {
url: src.replace(/\/[ip]\/+([-0-9a-f]{10,}\.[a-z]+)(?:[?#].*)?$/, "/i/$1"),
headers: {
Referer: "https://arbum.art"
},
can_head: false // 500
};
}




Expand Down Expand Up @@ -112569,12 +112616,23 @@ var $$IMU_EXPORT$$;
// https://icearenamsk.ru/upload/resize_cache/iblock/ef3/2hfictpoiiz0nrekjj6rkbwql841lzn6/775_500_2/1.jpg
// https://icearenamsk.ru/upload/iblock/ef3/2hfictpoiiz0nrekjj6rkbwql841lzn6/1.jpg
domain_nowww === "icearenamsk.ru" ||
// thanks to anonymous for reporting:
// https://spb.office-plus.ru/upload/webp/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya_mebel_layt_photo_01.webp
// https://spb.office-plus.ru/upload/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya-mebel-layt-photo-01.jpg
//domain === "spb.office-plus.ru" ||
// https://www.sb.by/upload/resize_cache/slam.image/iblock/2bb/855_2000_1/2bb028a9c7ce97a07fc667b3bd54f00c.JPG
// https://www.sb.by/upload/iblock/2bb/2bb028a9c7ce97a07fc667b3bd54f00c.JPG
src.match(/:\/\/[^/]*\/upload\/+resize_cache\/+(?:[^/]*\/+)?iblock\/+[0-9a-f]{3}\/+[0-9]+_[0-9]+_/) ||
// https://static.tatler.ru/resize_cache_imm/iblock/c30/ff92/326x489_Quality100_c30b71eb02b082af52e89d51d6146db8.jpg
// https://static.tatler.ru/iblock/c30/c30b71eb02b082af52e89d51d6146db8.jpg
src.match(/:\/\/[^/]*\/(?:upload\/+)?resize_cache_imm\/+iblock\/+[0-9a-f]{3}\/+[0-9a-f]{4}\/+[0-9]+x[0-9]+_Quality[0-9]+_[0-9a-f]+\./)) {
// https://spb.office-plus.ru/upload/webp/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya_mebel_layt_photo_01.webp
// https://spb.office-plus.ru/upload/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya-mebel-layt-photo-01.jpg
// https://spb.office-plus.ru/upload/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya_mebel_layt_photo_01.jpg -- 404
/*newsrc = src.replace(/(\/upload\/+)webp\/+(iblock\/+[0-9a-f]{3}\/+[0-9a-z]{10,}\/+[^/]+\.)webp(?:[?#].*)?$/, "$1$2jpg");
if (newsrc !== src)
return newsrc;*/

// http://krauzer.ru/upload/resize_cache/iblock/edf/600_600_1/edfdf59938b3ed07d5bad9c3da49e852.jpg
// http://krauzer.ru/upload/iblock/edf/edfdf59938b3ed07d5bad9c3da49e852.jpg
newsrc = src
Expand Down
54 changes: 54 additions & 0 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -24843,6 +24843,18 @@ var $$IMU_EXPORT$$;
newsrc = src.replace(/^[a-z]+:\/\/thumb\.([^/]*)\/+([^/]*\/+)?[0-9]{2}\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{8,}_[0-9]+\.)/, "http://image.$1/$2$3");
if (newsrc !== src)
return newsrc;
// thanks to anonymous for reporting:
// https://thumb.mtstarnews.com/star_realdisp.php?ImageID=2017051015315128279_2.jpg
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+star_realdisp\.php\?(?:.*&)?ImageID=([0-9]+_[0-9]+\.[a-z]+)(?:[&#].*)?$/,
run: function(cb, match) {
var url = match[1];
var urlmatch = url.match(/^([0-9]{4})([0-9]{2})/);
cb("https://thumb.mtstarnews.com/06/" + urlmatch[1] + "/" + urlmatch[2] + "/" + url);
}
});
if (newsrc)
return newsrc;
}
if (domain === "menu.mt.co.kr" ||
// https://img.koreatimes.co.kr/upload/thumbnailV2/590K2019061200203.jpg/dims/resize/720/optimize
Expand Down Expand Up @@ -99102,6 +99114,10 @@ var $$IMU_EXPORT$$;
}
}
if (domain === "images.kinorium.com" ||
// thanks to anonymous for reporting:
// https://images-s.kinorium.com/movie/shot/90483/h280_902025.jpg
// https://images-s.kinorium.com/movie/shot/90483/original_902025.jpg
domain === "images-s.kinorium.com" ||
// https://en-images.kinorium.com/movie/1080/234571.jpg?1613719646
// https://en-images.kinorium.com/movie/original/234571.jpg?1613719646 -- 2764x4096
domain === "en-images.kinorium.com") {
Expand Down Expand Up @@ -100152,6 +100168,34 @@ var $$IMU_EXPORT$$;
// https://images.comico.io/content/en/.../.../.../....jpg/dims/crop/x2000+0+0/optimize?Policy=...&Signature=...&Key-Pair-Id=...
return src.replace(/\/dims\/+[^?#]*([?#].*)?$/, "$1");
}
if (domain === "photos.eruce.com") {
// thanks to anonymous for reporting:
// https://photos.eruce.com/thumbs/1cd/295/d35/295/ec5/d35/6a3d0d460bb36567d2aab9d37391834a_500x500.webp
// https://photos.eruce.com/1cd/295/d35/295/ec5/d35/6a3d0d460bb36567d2aab9d37391834a.jpg
return src
.replace(/\/thumbs\/+(.*?)_[0-9]+x[0-9]+(\.jpg)(?:[?#].*)?$/, "/$1$2")
.replace(/\.webp(?:[?#].*)?$/, ".jpg");
}
if (domain === "img.rgstatic.com") {
// thanks to anonymous for reporting:
// https://img.rgstatic.com/content/movie/48e374b5-08ed-49bd-a920-71fd74a71f85/backdrop-1920.jpg
// https://img.rgstatic.com/content/movie/48e374b5-08ed-49bd-a920-71fd74a71f85/backdrop-original.jpg -- 2000x1125
// https://img.rgstatic.com/content/movie/fe1688d1-3d8f-493f-8ec4-8b5d28fe6e14/poster-780.jpg
// https://img.rgstatic.com/content/movie/fe1688d1-3d8f-493f-8ec4-8b5d28fe6e14/poster-original.jpg
return src.replace(/(\/content\/+[^/]+\/+[-0-9a-f]{10,}\/+[^/?#.]+-)[0-9]+\./, "$1original.");
}
if (domain === "an.arbum.art") {
// thanks to Froktime on github: https://github.com/qsniyg/maxurl/issues/1267
// https://an.arbum.art/i/[guid].png?preset=ArtworkPreview&size=200&ratio=1
// https://an.arbum.art/i/[guid].png
return {
url: src.replace(/\/[ip]\/+([-0-9a-f]{10,}\.[a-z]+)(?:[?#].*)?$/, "/i/$1"),
headers: {
Referer: "https://arbum.art"
},
can_head: false // 500
};
}
// -- 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 Expand Up @@ -100899,12 +100943,22 @@ var $$IMU_EXPORT$$;
// https://icearenamsk.ru/upload/resize_cache/iblock/ef3/2hfictpoiiz0nrekjj6rkbwql841lzn6/775_500_2/1.jpg
// https://icearenamsk.ru/upload/iblock/ef3/2hfictpoiiz0nrekjj6rkbwql841lzn6/1.jpg
domain_nowww === "icearenamsk.ru" ||
// thanks to anonymous for reporting:
// https://spb.office-plus.ru/upload/webp/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya_mebel_layt_photo_01.webp
// https://spb.office-plus.ru/upload/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya-mebel-layt-photo-01.jpg
//domain === "spb.office-plus.ru" ||
// https://www.sb.by/upload/resize_cache/slam.image/iblock/2bb/855_2000_1/2bb028a9c7ce97a07fc667b3bd54f00c.JPG
// https://www.sb.by/upload/iblock/2bb/2bb028a9c7ce97a07fc667b3bd54f00c.JPG
src.match(/:\/\/[^/]*\/upload\/+resize_cache\/+(?:[^/]*\/+)?iblock\/+[0-9a-f]{3}\/+[0-9]+_[0-9]+_/) ||
// https://static.tatler.ru/resize_cache_imm/iblock/c30/ff92/326x489_Quality100_c30b71eb02b082af52e89d51d6146db8.jpg
// https://static.tatler.ru/iblock/c30/c30b71eb02b082af52e89d51d6146db8.jpg
src.match(/:\/\/[^/]*\/(?:upload\/+)?resize_cache_imm\/+iblock\/+[0-9a-f]{3}\/+[0-9a-f]{4}\/+[0-9]+x[0-9]+_Quality[0-9]+_[0-9a-f]+\./)) {
// https://spb.office-plus.ru/upload/webp/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya_mebel_layt_photo_01.webp
// https://spb.office-plus.ru/upload/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya-mebel-layt-photo-01.jpg
// https://spb.office-plus.ru/upload/iblock/3b7/4d1tp9e0tkf2s4ld7ir465ej1y0gdua8/ofisnaya_mebel_layt_photo_01.jpg -- 404
/*newsrc = src.replace(/(\/upload\/+)webp\/+(iblock\/+[0-9a-f]{3}\/+[0-9a-z]{10,}\/+[^/]+\.)webp(?:[?#].*)?$/, "$1$2jpg");
if (newsrc !== src)
return newsrc;*/
// http://krauzer.ru/upload/resize_cache/iblock/edf/600_600_1/edfdf59938b3ed07d5bad9c3da49e852.jpg
// http://krauzer.ru/upload/iblock/edf/edfdf59938b3ed07d5bad9c3da49e852.jpg
newsrc = src
Expand Down

0 comments on commit ce4c471

Please sign in to comment.