Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Apr 30, 2024
1 parent a4febd5 commit 7576b30
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 0 deletions.
66 changes: 66 additions & 0 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113708,6 +113708,72 @@ var $$IMU_EXPORT$$;
return src.replace(/\/render\/+w[0-9]+\/+/, "/content/");
}

if (amazon_container === "kb-tenant-data") {
// thanks to anonymous for reporting:
// https://s3.amazonaws.com/kb-tenant-data/31e8fafc-c06d-4622-af6d-cf67c2132c48/uploads/images/1664vz9kfM45XzSi/thumb/rnnsn37g.jpg -- 350x350
// https://s3.amazonaws.com/kb-tenant-data/31e8fafc-c06d-4622-af6d-cf67c2132c48/uploads/images/1664vz9kfM45XzSi/medium/rnnsn37g.jpg -- 900x900
// https://s3.amazonaws.com/kb-tenant-data/31e8fafc-c06d-4622-af6d-cf67c2132c48/uploads/images/1664vz9kfM45XzSi/large/rnnsn37g.jpg -- 1024x1024
return src.replace(/(\/uploads\/+images\/+[^/]+\/+)(?:thumb|medium)\/+/, "$1large/");
}

if (domain === "i.icanvas.com") {
// thanks to anonymous for reporting:
// https://i.icanvas.com/NRL39?d=3&sh=h&s=xl&p=1&bg=c&t=1708237566
// https://i.icanvas.com/NRL39?sh=h&s=xxl&d=0 -- 1200x800
return add_queries(keep_queries(src, ["sh", "s", "d"]), {"d": "0"}).replace(/([?&]s=)(?:[sml]|xl)/, "$1xxl");
}

if (domain_nowww === "thevintageposter.com") {
// thanks to anonymous for reporting:
// https://www.thevintageposter.com/Art_Images/Small/TN18212.jpg
// https://www.thevintageposter.com/Art_Images/Medium/18212.jpg -- 1500x1156
return src.replace(/(\/Art_Images\/+)Small\/+TN/, "$1Medium/");
}

if (domain_nowww === "tenor.com") {
// thanks to anonymous for reporting:
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+(?:[a-z]+\/+)?view\/+[^/?#]+-([0-9]+)(?:[?#].*)?$/,
query_for_id: "https://tenor.com/view/${id}",
process: function(done, resp, cache_key, urlmatch) {
let match = resp.responseText.match(/<script id="store-cache"[^>]*>({.*?})<\/script>/);
if (!match) {
console_error(cache_key, "Unable to find store-cache match for", resp);
return done(null, false);
}

let json = JSON_parse(match[1]);
let id = urlmatch[1];
let data = json.gifs.byId[id].results[0];

let obj = {
extra: {
page: data.itemurl,
created_date: data.created * 1000,
caption: data.h1_title,
author_username: data.user.username
}
};

let urls = [];

if (data.media_formats.mp4) {
urls.push({
url: data.media_formats.mp4.url,
video: true
});
}

if (data.media_formats.gif) {
urls.push(data.media_formats.gif.url);
}

return done(fillobj_urls(urls, obj), 6*60*60);
}
});
if (newsrc) return newsrc;
}




Expand Down
57 changes: 57 additions & 0 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -102086,6 +102086,63 @@ var $$IMU_EXPORT$$;
// https://www.esprit-photo.com/content/09.vie_paroisses/11.paroisse-saint-jean-baptiste-libourne-bordeaux/06.veillees/01.Veillee-Sainte-Marie-Madeleine-a-St-Jean-Baptiste-de-Libourne/__Veillee-Sainte-Marie-Madeleine-a-St-Jean-Baptiste-de-Libourne.jpg -- 2114x3038
return src.replace(/\/render\/+w[0-9]+\/+/, "/content/");
}
if (amazon_container === "kb-tenant-data") {
// thanks to anonymous for reporting:
// https://s3.amazonaws.com/kb-tenant-data/31e8fafc-c06d-4622-af6d-cf67c2132c48/uploads/images/1664vz9kfM45XzSi/thumb/rnnsn37g.jpg -- 350x350
// https://s3.amazonaws.com/kb-tenant-data/31e8fafc-c06d-4622-af6d-cf67c2132c48/uploads/images/1664vz9kfM45XzSi/medium/rnnsn37g.jpg -- 900x900
// https://s3.amazonaws.com/kb-tenant-data/31e8fafc-c06d-4622-af6d-cf67c2132c48/uploads/images/1664vz9kfM45XzSi/large/rnnsn37g.jpg -- 1024x1024
return src.replace(/(\/uploads\/+images\/+[^/]+\/+)(?:thumb|medium)\/+/, "$1large/");
}
if (domain === "i.icanvas.com") {
// thanks to anonymous for reporting:
// https://i.icanvas.com/NRL39?d=3&sh=h&s=xl&p=1&bg=c&t=1708237566
// https://i.icanvas.com/NRL39?sh=h&s=xxl&d=0 -- 1200x800
return add_queries(keep_queries(src, ["sh", "s", "d"]), { "d": "0" }).replace(/([?&]s=)(?:[sml]|xl)/, "$1xxl");
}
if (domain_nowww === "thevintageposter.com") {
// thanks to anonymous for reporting:
// https://www.thevintageposter.com/Art_Images/Small/TN18212.jpg
// https://www.thevintageposter.com/Art_Images/Medium/18212.jpg -- 1500x1156
return src.replace(/(\/Art_Images\/+)Small\/+TN/, "$1Medium/");
}
if (domain_nowww === "tenor.com") {
// thanks to anonymous for reporting:
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+(?:[a-z]+\/+)?view\/+[^/?#]+-([0-9]+)(?:[?#].*)?$/,
query_for_id: "https://tenor.com/view/${id}",
process: function(done, resp, cache_key, urlmatch) {
var match = resp.responseText.match(/<script id="store-cache"[^>]*>({.*?})<\/script>/);
if (!match) {
console_error(cache_key, "Unable to find store-cache match for", resp);
return done(null, false);
}
var json = JSON_parse(match[1]);
var id = urlmatch[1];
var data = json.gifs.byId[id].results[0];
var obj = {
extra: {
page: data.itemurl,
created_date: data.created * 1000,
caption: data.h1_title,
author_username: data.user.username
}
};
var urls = [];
if (data.media_formats.mp4) {
urls.push({
url: data.media_formats.mp4.url,
video: true
});
}
if (data.media_formats.gif) {
urls.push(data.media_formats.gif.url);
}
return done(fillobj_urls(urls, obj), 6 * 60 * 60);
}
});
if (newsrc)
return newsrc;
}
// -- 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

0 comments on commit 7576b30

Please sign in to comment.