Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Aug 18, 2024
1 parent 3611902 commit 3a2f426
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19652,6 +19652,8 @@ var $$IMU_EXPORT$$;
};

var add_http = function(url:string):string {
if (/^\/\/[^/]+\.[a-z]+\//.test(url))
return "http:" + url;
if (!url.match(/^[a-z]+:\/\//))
return "http://" + url;
return url;
Expand Down Expand Up @@ -109699,7 +109701,7 @@ var $$IMU_EXPORT$$;
// http://fan7.s3.eu-west-1.amazonaws.com/littleprincess/1621c41d91520077
let queries = get_queries(src);
if (queries.url) {
return add_http(decodeuri_ifneeded(queries.url));
return add_http(decodeURIComponent(queries.url));
}
}

Expand Down Expand Up @@ -110610,6 +110612,10 @@ var $$IMU_EXPORT$$;
// https://imagenes.elpais.com/resizer/v2/Q65QV6AOQFD67GSRGNODWVDEEQ.jpg?auth=a24d3386f30004dcad48575ed42b4cf3b3cb913397bb4e1485760a34b967b66c&width=828&height=466&smart=true
// https://cloudfront-eu-central-1.images.arcpublishing.com/prisa/Q65QV6AOQFD67GSRGNODWVDEEQ.jpg
domain === "imagenes.elpais.com" ||
// thanks to anonymous for reporting:
// https://www.shropshirestar.com/resizer/v2/ANHB4KU4BRDX3P4JJYZ66FCWM4.jpg?auth=14ad374e17db437d9a7b335e256dfd7619c5f68c106ad6d11e27e85a489e0296&width=1200&height=900
// https://cloudfront-us-east-1.images.arcpublishing.com/mna/ANHB4KU4BRDX3P4JJYZ66FCWM4.jpg
domain_nowww === "shropshirestar.com" ||
// thanks to roi:
// https://www.theglobeandmail.com/resizer/v2/MIMBGW3UORBLZMMTL2GASZ75JE.JPG?auth=c570680e25c89027c795085ce398d06291485e026f2830e996db3e2d9a71d3d8&width=900&quality=80
// https://cloudfront-us-east-1.images.arcpublishing.com/tgam/MIMBGW3UORBLZMMTL2GASZ75JE.JPG
Expand All @@ -110629,6 +110635,8 @@ var $$IMU_EXPORT$$;
info = {folder: "tgam", loc: "us-east-1"};
else if (domain === "imagenes.elpais.com")
info = {folder: "prisa", loc: "eu-central-1"};
else if (domain_nowww === "shropshirestar.com")
info = {folder: "mna", loc: "us-east-1"};

newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+resizer\/+v2\/+([^?#/]+)(?:[?#].*)?$/, "https://cloudfront-" + info.loc + ".images.arcpublishing.com/" + info.folder + "/$1");
if (newsrc !== src)
Expand Down
10 changes: 9 additions & 1 deletion userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -18623,6 +18623,8 @@ var $$IMU_EXPORT$$;
}
};
var add_http = function(url) {
if (/^\/\/[^/]+\.[a-z]+\//.test(url))
return "http:" + url;
if (!url.match(/^[a-z]+:\/\//))
return "http://" + url;
return url;
Expand Down Expand Up @@ -98610,7 +98612,7 @@ var $$IMU_EXPORT$$;
// http://fan7.s3.eu-west-1.amazonaws.com/littleprincess/1621c41d91520077
var queries_2 = get_queries(src);
if (queries_2.url) {
return add_http(decodeuri_ifneeded(queries_2.url));
return add_http(decodeURIComponent(queries_2.url));
}
}
if (domain === "static.harpersbazaar.de") {
Expand Down Expand Up @@ -99443,6 +99445,10 @@ var $$IMU_EXPORT$$;
// https://imagenes.elpais.com/resizer/v2/Q65QV6AOQFD67GSRGNODWVDEEQ.jpg?auth=a24d3386f30004dcad48575ed42b4cf3b3cb913397bb4e1485760a34b967b66c&width=828&height=466&smart=true
// https://cloudfront-eu-central-1.images.arcpublishing.com/prisa/Q65QV6AOQFD67GSRGNODWVDEEQ.jpg
domain === "imagenes.elpais.com" ||
// thanks to anonymous for reporting:
// https://www.shropshirestar.com/resizer/v2/ANHB4KU4BRDX3P4JJYZ66FCWM4.jpg?auth=14ad374e17db437d9a7b335e256dfd7619c5f68c106ad6d11e27e85a489e0296&width=1200&height=900
// https://cloudfront-us-east-1.images.arcpublishing.com/mna/ANHB4KU4BRDX3P4JJYZ66FCWM4.jpg
domain_nowww === "shropshirestar.com" ||
// thanks to roi:
// https://www.theglobeandmail.com/resizer/v2/MIMBGW3UORBLZMMTL2GASZ75JE.JPG?auth=c570680e25c89027c795085ce398d06291485e026f2830e996db3e2d9a71d3d8&width=900&quality=80
// https://cloudfront-us-east-1.images.arcpublishing.com/tgam/MIMBGW3UORBLZMMTL2GASZ75JE.JPG
Expand All @@ -99461,6 +99467,8 @@ var $$IMU_EXPORT$$;
info_1 = { folder: "tgam", loc: "us-east-1" };
else if (domain === "imagenes.elpais.com")
info_1 = { folder: "prisa", loc: "eu-central-1" };
else if (domain_nowww === "shropshirestar.com")
info_1 = { folder: "mna", loc: "us-east-1" };
newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+resizer\/+v2\/+([^?#/]+)(?:[?#].*)?$/, "https://cloudfront-" + info_1.loc + ".images.arcpublishing.com/" + info_1.folder + "/$1");
if (newsrc !== src)
return newsrc;
Expand Down

0 comments on commit 3a2f426

Please sign in to comment.