Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Dec 16, 2023
1 parent 659d542 commit ed1814f
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 60 deletions.
53 changes: 42 additions & 11 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32155,6 +32155,9 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://groundnews.b-cdn.net/assets/web/images/about-us/Pointing_Digital_Cutout%201-new.png?width=100
(domain === "groundnews.b-cdn.net" && /\/assets\/+web\/+images\//.test(src)) ||
// thanks to anonymous for reporting:
// https://images.pangobooks.com/images/4a04886a-7c70-4faa-9872-b1822b5be83e?width=800&quality=85&crop=1%3A1
domain === "images.pangobooks.com" ||
// http://us.jimmychoo.com/dw/image/v2/AAWE_PRD/on/demandware.static/-/Sites-jch-master-product-catalog/default/dw70b1ebd2/images/rollover/LIZ100MPY_120004_MODEL.jpg?sw=245&sh=245&sm=fit
// https://www.aritzia.com/on/demandware.static/-/Library-Sites-Aritzia_Shared/default/dw3a7fef87/seasonal/ss18/ss18-springsummercampaign/ss18-springsummercampaign-homepage/hptiles/tile-wilfred-lrg.jpg
src.match(/\/demandware\.static\//) ||
Expand Down Expand Up @@ -84744,20 +84747,44 @@ var $$IMU_EXPORT$$;

var urls = [];

var baseurl = get_meta(resp.responseText, "og:image");
if (!baseurl) {
console_error(cache_key, "Unable to find base image URL for", resp);
return done(null, false);
var assetinfomatch = resp.responseText.match(/<script type="application\/json" data-component='AssetDetail'>\s*({.*})\s*<\/script>/);
if (!assetinfomatch) {
console_warn(cache_key, "Unable to find asset detail match for", resp);
} else {
let json = JSON_parse(assetinfomatch[1]);
urls.push({
url: json.asset.largeMainImageURL,
problems: {
watermark: true
}
});

urls.push({
url: json.asset.thumb612Url,
problems: {
smaller: true
}
});
}

baseurl = common_functions["getty_transform_url"](baseurl);
var largerurl = baseurl.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
urls.push({
url: largerurl,
problems: {
watermark: true
// doesn't work anymore
if (false) {
var baseurl = get_meta(resp.responseText, "og:image");
if (!baseurl) {
console_error(cache_key, "Unable to find base image URL for", resp);
return done(null, false);
}
});

baseurl = common_functions["getty_transform_url"](baseurl);

var largerurl = baseurl.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
urls.push({
url: largerurl,
problems: {
watermark: true
}
});
}

// debugging tool, prints all image urls
if (false) {
Expand Down Expand Up @@ -84821,6 +84848,8 @@ var $$IMU_EXPORT$$;
// https://media.gettyimages.com/photos/silhouettes-of-concert-crowd-id641915860?s=2048x2048&w=5
let imageinfo = common_functions["getty_image_info"](src);
if (imageinfo) {
// can't transform anymore
if (false) {
if (src.match(/\/(?:photos|vectors)\/+[^/?]*-id[0-9]+(?:[?#].*)?$/)) {
let problems = undefined;
if (!imageinfo["watermark"]) {
Expand Down Expand Up @@ -84854,6 +84883,7 @@ var $$IMU_EXPORT$$;
return newsrc;
}
}
}

return {
url: "https://www.gettyimages.com/detail/a/a/" + imageinfo["id"],
Expand Down Expand Up @@ -109721,6 +109751,7 @@ var $$IMU_EXPORT$$;
if (domain === "manhua.acimg.cn") {
// thanks to anonymous for reporting:
// https://manhua.acimg.cn/vertical/0/30_19_15_325982f153d0f3d4b52d617a579da96e_1640862941502.jpg/420
// https://manhua.acimg.cn/vertical/0/30_19_15_325982f153d0f3d4b52d617a579da96e_1640862941502.jpg/0
return {
url: src.replace(/(\/(?:vertical|horizontal)\/.*\/)[0-9]+(?:[?#].*)?$/, "$10"),
headers: {
Expand Down
126 changes: 77 additions & 49 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -29373,6 +29373,9 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://groundnews.b-cdn.net/assets/web/images/about-us/Pointing_Digital_Cutout%201-new.png?width=100
(domain === "groundnews.b-cdn.net" && /\/assets\/+web\/+images\//.test(src)) ||
// thanks to anonymous for reporting:
// https://images.pangobooks.com/images/4a04886a-7c70-4faa-9872-b1822b5be83e?width=800&quality=85&crop=1%3A1
domain === "images.pangobooks.com" ||
// http://us.jimmychoo.com/dw/image/v2/AAWE_PRD/on/demandware.static/-/Sites-jch-master-product-catalog/default/dw70b1ebd2/images/rollover/LIZ100MPY_120004_MODEL.jpg?sw=245&sh=245&sm=fit
// https://www.aritzia.com/on/demandware.static/-/Library-Sites-Aritzia_Shared/default/dw3a7fef87/seasonal/ss18/ss18-springsummercampaign/ss18-springsummercampaign-homepage/hptiles/tile-wilfred-lrg.jpg
src.match(/\/demandware\.static\//) ||
Expand Down Expand Up @@ -76279,19 +76282,40 @@ var $$IMU_EXPORT$$;
if (description)
obj.extra.caption = description;
var urls = [];
var baseurl = get_meta(resp.responseText, "og:image");
if (!baseurl) {
console_error(cache_key, "Unable to find base image URL for", resp);
return done(null, false);
var assetinfomatch = resp.responseText.match(/<script type="application\/json" data-component='AssetDetail'>\s*({.*})\s*<\/script>/);
if (!assetinfomatch) {
console_warn(cache_key, "Unable to find asset detail match for", resp);
} else {
var json_1 = JSON_parse(assetinfomatch[1]);
urls.push({
url: json_1.asset.largeMainImageURL,
problems: {
watermark: true
}
});
urls.push({
url: json_1.asset.thumb612Url,
problems: {
smaller: true
}
});
}
baseurl = common_functions["getty_transform_url"](baseurl);
var largerurl = baseurl.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
urls.push({
url: largerurl,
problems: {
watermark: true
// doesn't work anymore
if (false) {
var baseurl = get_meta(resp.responseText, "og:image");
if (!baseurl) {
console_error(cache_key, "Unable to find base image URL for", resp);
return done(null, false);
}
});
baseurl = common_functions["getty_transform_url"](baseurl);
var largerurl = baseurl.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
urls.push({
url: largerurl,
problems: {
watermark: true
}
});
}
// debugging tool, prints all image urls
if (false) {
var matched_urls = resp.responseText.match(/"(https?:\/\/media\.gettyimages\.com\/+[^"]+)"/g);
Expand Down Expand Up @@ -76352,35 +76376,38 @@ var $$IMU_EXPORT$$;
// https://media.gettyimages.com/photos/silhouettes-of-concert-crowd-id641915860?s=2048x2048&w=5
var imageinfo = common_functions["getty_image_info"](src);
if (imageinfo) {
if (src.match(/\/(?:photos|vectors)\/+[^/?]*-id[0-9]+(?:[?#].*)?$/)) {
var problems = undefined;
if (!imageinfo["watermark"]) {
problems = { watermark: true };
// can't transform anymore
if (false) {
if (src.match(/\/(?:photos|vectors)\/+[^/?]*-id[0-9]+(?:[?#].*)?$/)) {
var problems = undefined;
if (!imageinfo["watermark"]) {
problems = { watermark: true };
}
newsrc = src.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
if (newsrc !== src) {
return {
url: newsrc,
head_wrong_contenttype: true,
head_wrong_contentlength: true,
problems: problems
};
}
}
newsrc = src.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
// thanks to roi:
// https://media.gettyimages.com/id/1244039921/photo/gabon-accession-to-the-commonwealth.webp?s=2048x2048&w=gi&k=20&c=pEsfFAm-QC-M8QLeFF4tqMHKKrVP-zbC0kOzNEBcuK0=
// https://media.gettyimages.com/photos/gabon-accession-to-the-commonwealth-id1244039921?s=2048x2048&w=5
newsrc = common_functions["getty_transform_url"](src);
if (newsrc !== src) {
return {
url: newsrc,
head_wrong_contenttype: true,
head_wrong_contentlength: true,
problems: problems
};
}
}
// thanks to roi:
// https://media.gettyimages.com/id/1244039921/photo/gabon-accession-to-the-commonwealth.webp?s=2048x2048&w=gi&k=20&c=pEsfFAm-QC-M8QLeFF4tqMHKKrVP-zbC0kOzNEBcuK0=
// https://media.gettyimages.com/photos/gabon-accession-to-the-commonwealth-id1244039921?s=2048x2048&w=5
newsrc = common_functions["getty_transform_url"](src);
if (newsrc !== src) {
if (!imageinfo["watermark"]) {
return {
url: newsrc,
problems: {
watermark: true
}
};
} else {
return newsrc;
if (!imageinfo["watermark"]) {
return {
url: newsrc,
problems: {
watermark: true
}
};
} else {
return newsrc;
}
}
}
return {
Expand Down Expand Up @@ -96299,9 +96326,9 @@ var $$IMU_EXPORT$$;
match = src.match(/^[a-z]+:\/\/[^/]+\/+(eyJ[^/?#]+)(?:[?#].*)?$/);
if (match) {
var decoded_3 = base64_decode(match[1]);
var json_1 = JSON_parse(decoded_3);
if (json_1.bucket && json_1.key)
return "https://" + json_1.bucket + ".s3.amazonaws.com/" + json_1.key;
var json_2 = JSON_parse(decoded_3);
if (json_2.bucket && json_2.key)
return "https://" + json_2.bucket + ".s3.amazonaws.com/" + json_2.key;
}
}
if (domain_nowww === "society6.com") {
Expand Down Expand Up @@ -96417,8 +96444,8 @@ var $$IMU_EXPORT$$;
var jsonstr_1 = base64_decode(splitted_2[0]);
if (splitted_2[1])
jsonstr_1 += "?" + base64_decode(splitted_2[1]);
var json_2 = JSON_parse(jsonstr_1);
return json_2.url;
var json_3 = JSON_parse(jsonstr_1);
return json_3.url;
}
}
if (domain_nowww === "pictures.immobilienscout24.de") {
Expand Down Expand Up @@ -97314,8 +97341,8 @@ var $$IMU_EXPORT$$;
return array_indexof(formats, a_f) - array_indexof(formats, b_f);
});
var urls = [];
for (var _i = 0, json_3 = json; _i < json_3.length; _i++) {
var obj_7 = json_3[_i];
for (var _i = 0, json_4 = json; _i < json_4.length; _i++) {
var obj_7 = json_4[_i];
urls.push({
url: urljoin("https://" + domain + "/", vxxx_b64_1(obj_7.video_url), true),
video: true
Expand Down Expand Up @@ -98000,8 +98027,8 @@ var $$IMU_EXPORT$$;
};
var match = resp.responseText.match(/<script type="application\/ld\+json" class="yoast-schema-graph">({.*?})<\/script>/);
if (match) {
var json_4 = JSON_parse(match[1]);
for (var _i = 0, _a = json_4["@graph"]; _i < _a.length; _i++) {
var json_5 = JSON_parse(match[1]);
for (var _i = 0, _a = json_5["@graph"]; _i < _a.length; _i++) {
var graph = _a[_i];
if (graph["@type"] !== "Article")
continue;
Expand Down Expand Up @@ -98326,8 +98353,8 @@ var $$IMU_EXPORT$$;
// https://singulart-website-prod.s3.amazonaws.com/collections/v2/pictures/cropped/cover/base/6903_cover_e169291e06f971f3f012842601e70f7d.jpeg
match = src.match(/\/images-sh\/+(eyJ[^/?#.]+)/);
if (match) {
var json_5 = JSON_parse(base64_decode(match[1]));
return "https://" + json_5.bucket + ".s3.amazonaws.com/" + json_5.key.replace(/\/+/, "/");
var json_6 = JSON_parse(base64_decode(match[1]));
return "https://" + json_6.bucket + ".s3.amazonaws.com/" + json_6.key.replace(/\/+/, "/");
}
}
if (domain_nowww === "allinks.me") {
Expand Down Expand Up @@ -98450,6 +98477,7 @@ var $$IMU_EXPORT$$;
if (domain === "manhua.acimg.cn") {
// thanks to anonymous for reporting:
// https://manhua.acimg.cn/vertical/0/30_19_15_325982f153d0f3d4b52d617a579da96e_1640862941502.jpg/420
// https://manhua.acimg.cn/vertical/0/30_19_15_325982f153d0f3d4b52d617a579da96e_1640862941502.jpg/0
return {
url: src.replace(/(\/(?:vertical|horizontal)\/.*\/)[0-9]+(?:[?#].*)?$/, "$10"),
headers: {
Expand Down

0 comments on commit ed1814f

Please sign in to comment.