Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed May 28, 2024
1 parent cc5014b commit b0a03b2
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Improvements:

* Various improvements/fixes to existing rules (including Flickr, iTunes, Soundcloud, Threads, TikTok, Tumblr)
* Various improvements/fixes to existing rules (including Flickr, iTunes, Patreon, Soundcloud, Threads, TikTok, Tumblr)

Bugfixes:

Expand Down
139 changes: 127 additions & 12 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31537,7 +31537,9 @@ var $$IMU_EXPORT$$;
// http://prd2-bone-image.s3-website-eu-west-1.amazonaws.com/voi/2018/09/05/f6deca2b-fea8-4f1b-8045-fa30eb8515df.jpeg
// http://img.ptv.pmdstatic.net/fit/http.3A.2F.2Fphoto.2Eprogramme.2Etv.2Fupload.2Fslideshow.2Fla-robe-transparente-de-blake-lively-enflamme-le-tapis-rouge-6107.2Fptvs-30022367865-101198.2Ejpg/102x81/crop-from/top/quality/80/blake-lively-au-top-dans-sa-robe-de-sirene.jpg
// http://photo.programme.tv/upload/slideshow/la-robe-transparente-de-blake-lively-enflamme-le-tapis-rouge-6107/ptvs-30022367865-101198.jpg -- 404, but url looks correct
var base = src.replace(/^[a-z]+:\/\/[^/]+\/+fit\/+(https?\.3A[^/]+)\/.*/, "$1");
// https://tls.img.pmdstatic.net/scale/http.3A.2F.2Fprd2-bone-image.2Es3-website-eu-west-1.2Eamazonaws.2Ecom.2FTLS.2F2019.2F09.2F20.2F6b64c3e0-3249-4052-ac96-070509713401.2Epng/autox450/quality/65/crop-from/center/picture.jpeg
// http://prd2-bone-image.s3-website-eu-west-1.amazonaws.com/TLS/2019/09/20/6b64c3e0-3249-4052-ac96-070509713401.png
var base = src.replace(/^[a-z]+:\/\/[^/]+\/+(?:fit|scale)\/+(https?\.3A[^/]+)\/.*/, "$1");
if (base !== src) {
base = base.replace(/\./g, "%");
base = decodeURIComponent(base);
Expand Down Expand Up @@ -31572,6 +31574,29 @@ var $$IMU_EXPORT$$;
return src.replace(/^[a-z]+:\/\/[^/]+\/+imgre\//, "https://gal.img.pmdstatic.net/");
}

if (domain_nowww === "programme.tv") {
// thanks to anonymous for reporting:
// https://www.programme.tv/imgre/fit/~1~tls~2022~01~14~d4150d48-2fa5-4cc5-a26a-7223b8fc3ed4.jpeg/660x370/crop-from/top/quality/80/focus-point/2115,2297/un-village-a-la-diete-quand-tf1-met-toute-une-commune-au-regime.jpg
// https://i.pmdstatic.net/tls/2022/01/14/d4150d48-2fa5-4cc5-a26a-7223b8fc3ed4.jpeg
// https://www.programme.tv/imgre/fit/~1~tel~2024~05~24~45f70d11-7b14-44c3-a648-96d4e723b975.jpeg/640x360/crop-from/top/quality/80/le-remplacant-ce-qu-il-faut-savoir-sur-la-saison-2.jpg
// https://i.pmdstatic.net/tel/2024/05/24/45f70d11-7b14-44c3-a648-96d4e723b975.jpeg
// https://www.programme.tv/imgre/fit/~1~gal~2023~04~24~3a1912e1-f015-4c38-8ddb-465eec4da517.jpeg/107x59/quality/80/affaire-pierre-palmade-le-comedien-va-etre-juge-pour-blessures-involontaires.jpg
// https://i.pmdstatic.net/gal/2023/04/24/3a1912e1-f015-4c38-8ddb-465eec4da517.jpeg
// other:
// https://www.programme.tv/imgre/fit/~2~program~2f56ff1da0a77487.jpg/630x355/quality/80/la-grande-semaine.jpg
match = src.match(/\/imgre\/+(?:fit|scale)\/+~1~(tls|tel|gal)~([0-9]{4})~([0-9]{2})~([0-9]{2})~([-0-9a-f]{10,}\.[a-z]+)\//);
if (match) {
return "https://i.pmdstatic.net/" + match[1] + "/" + match[2] + "/" + match[3] + "/" + match[4] + "/" + match[5];
}

// https://www.programme.tv/imgre/fit/http.3A.2F.2Fprmd.2Etmsimg.2Ecom.2Fassets.2Fp3537284_v_s3_aj.2Ejpg/630x355/quality/80/crop-from/top/princess-protection-program-mission-rosalinda.jpg
// https://prmd.tmsimg.com/assets/p3537284_v_s3_aj.jpg
match = src.match(/\/imgre\/+(?:fit|scale)\/+(https?\.3A\.2F\.2F[^/]+)\//);
if (match) {
return src.replace(/^[a-z]+:\/\/[^/]+\/+imgre\/+/, "https://img.voi.pmdstatic.net/");
}
}

if (domain === "dynaimage.cdn.cnn.com") {
// https://dynaimage.cdn.cnn.com/cnn/q_auto,w_672,c_fill/http%3A%2F%2Fcdn.cnn.com%2Fcnnnext%2Fdam%2Fassets%2F170428012205-28-met-gala-kurkova.jpg
// http://cdn.cnn.com/cnnnext/dam/assets/170428012205-28-met-gala-kurkova.jpg
Expand Down Expand Up @@ -36189,10 +36214,7 @@ var $$IMU_EXPORT$$;
return add_http(newsrc);
}

if (domain_nosub === "alicdn.com" &&
(domain.match(/[0-9]*\.alicdn\.com/) ||
//domain.match(/sc[0-9]*\.alicdn\.com/) ||
domain === "img.alicdn.com")) {
if (domain_nosub === "alicdn.com") {
// https://ae01.alicdn.com/kf/HTB1AMo8a4uaVKJjSZFjq6AjmpXai/BINYEAE-new-CD-seal-State-of-Grace-Paul-Schwartz-Lisbeth-Scott-CD-disc-free-shipping.jpg_640x640.jpg
// https://ae01.alicdn.com/kf/HTB1AMo8a4uaVKJjSZFjq6AjmpXai/BINYEAE-new-CD-seal-State-of-Grace-Paul-Schwartz-Lisbeth-Scott-CD-disc-free-shipping.jpg
// https://ae01.alicdn.com/kf/HT1N7knFG0dXXagOFbXQ/220255879/HT1N7knFG0dXXagOFbXQ.jpg?size=209686&height=1472&width=970&hash=b068627a285860c5226596bada694403
Expand All @@ -36208,9 +36230,12 @@ var $$IMU_EXPORT$$;
// thanks to AdClear247 on github: https://github.com/qsniyg/maxurl/issues/696
// https://ae01.alicdn.com/kf/H2c12a31220bd493e9179002b39df1788P/Cooling-Skull-Cap-Breathable-Sweat-Wicking-Cycling-Running-Hat-Cap-Odorless-and-Sweat-absorbent-sweat-absorbent.jpg_q10.jpg
// https://ae01.alicdn.com/kf/H2c12a31220bd493e9179002b39df1788P/Cooling-Skull-Cap-Breathable-Sweat-Wicking-Cycling-Running-Hat-Cap-Odorless-and-Sweat-absorbent-sweat-absorbent.jpg
// thanks to anonymous for reporting:
// https://gw.alicdn.com/imgextra/i1/111942793/O1CN011WVEgBtKvAdl7O0_!!111942793.jpg_110x10000Q75.jpg
// https://gw.alicdn.com/imgextra/i1/111942793/O1CN011WVEgBtKvAdl7O0_!!111942793.jpg
return src
.replace(/\.[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1")
.replace(/(\.[^/._?#]+)_(?:[0-9z]+x[0-9z]+(?:x[0-9z]+)?|[qQ][0-9]+)\.[^/.]+$/, "$1")
.replace(/(\.[^/._?#]+)_(?:[0-9z]+x[0-9z]+(?:x[0-9z]+)?)?(?:[qQ][0-9]+)?\.[^/.]+$/, "$1")
.replace(/(\.[^/._?#]+)_\.webp(?:[?#].*)?$/, "$1")
.replace(/\?.*/, "");
}
Expand Down Expand Up @@ -38867,6 +38892,13 @@ var $$IMU_EXPORT$$;
if (newsrc !== src)
return newsrc;

// thanks to anonymous:
// https://graphics8.nytimes.com/images/2008/11/02/opinion/02chart_190h.jpg
// https://graphics8.nytimes.com/images/2008/11/02/opinion/02chart_large.jpg
newsrc = src.replace(/(\/images\/.*)_[0-9]+h(\.[a-z]+)$/, "$1_large$2");
if (newsrc !== src)
return newsrc;

var matched = src.match(/-([^-_/.]*?)(?:-v[0-9]*)?\.[^/.]*$/);
if (matched) {
if (matched[1] === "jumbo" ||
Expand Down Expand Up @@ -61627,7 +61659,11 @@ var $$IMU_EXPORT$$;
return src.replace(/\/galerie\/[a-z]+\/[a-z]+-/, "/galerie/grande/max-");
}

if (domain === "celeb.gate.cc") {
if (domain === "celeb.gate.cc" ||
// thanks to anonymous for reporting:
// https://celebgate.org/media/cache/headshot/upload/n/o/noel-berry-private-photos-58695.jpg
// https://celebgate.org/media/cache/image/upload/n/o/noel-berry-private-photos-58695.jpg
domain_nowww == "celebgate.org") {
// http://celeb.gate.cc/media/cache/headshot/upload/d/a/danielle-panabaker-leather-874342.jpeg
// http://celeb.gate.cc/media/cache/original/upload/d/a/danielle-panabaker-leather-874342.jpeg
// https://celeb.gate.cc/media/cache/image/upload/d/a/danielle-panabaker-leather-874342.jpeg -- 934x1400
Expand Down Expand Up @@ -63120,7 +63156,8 @@ var $$IMU_EXPORT$$;
Referer: origpage || basedomain
},
extra: {
page: origpage
page: origpage,
caption: data.video_title || data.video_tags || data.video_categories || void 0
}
};

Expand Down Expand Up @@ -88829,7 +88866,14 @@ var $$IMU_EXPORT$$;
if (json.props && json.props.pageProps) {
json = json.props.pageProps.bootstrapEnvelope;
}
json = json.bootstrap;

if (json.bootstrap)
json = json.bootstrap;
else if (json.pageBootstrap)
json = json.pageBootstrap;
else {
console.warn(cache_key, "No boostrap in", json);
}

var post = json.post;
var attributes = post.data.attributes;
Expand Down Expand Up @@ -102072,6 +102116,10 @@ var $$IMU_EXPORT$$;
// https://demo.ghost.io/
// https://github.com/TryGhost/Ghost/blob/34d2cc1b0b022895c621aeb8e26ad48bf8f81357/core/server/web/site/middleware/handle-image-sizes.js
if (domain === "blog.froggi.es" ||
// thanks to anonymous for reporting:
// https://itsfoss.com/content/images/size/w100/format/webp/2024/05/esssential-linux-commands-for-malware-analysis.png
// https://itsfoss.com/content/images/2024/05/esssential-linux-commands-for-malware-analysis.png
domain_nowww === "itsfoss.com" ||
// thanks to Noodlers on discord:
// https://blog.emojipedia.org/content/images/size/w300/2021/04/new-twemoji-2021-emojipedia.jpg
// https://blog.emojipedia.org/content/images/size/w2000/2021/04/new-twemoji-2021-emojipedia.jpg
Expand All @@ -102082,7 +102130,8 @@ var $$IMU_EXPORT$$;
// https://blog.froggi.es/content/images/size/w2400/2020/11/image-2.png -- 2402x1390
// https://blog.froggi.es/content/images/2020/11/image-2.png -- 2000x1157, downscaled
// /size/original/ redirects to /content/images/, but is not the original size for the control trace
return src.replace(/(\/content\/+images\/+)size\/+[wh](?:1?[0-9]{1,3}|2000)\/+/, "$1");
//return src.replace(/(\/content\/+images\/+)size\/+[wh](?:1?[0-9]{1,3}|2000)\/+/, "$1");
return src.replace(/(\/content\/+images\/+)(?:(?:size|format)\/+[^/]+\/+)+/, "$1");
}

if (domain === "em-content.zobj.net") {
Expand Down Expand Up @@ -107336,7 +107385,10 @@ var $$IMU_EXPORT$$;
if (domain === "images.perthnow.com.au") {
// https://images.perthnow.com.au/publication/C-3803742/58387c44af486efc5a26b39ff4a2efd0d6e14c67-16x9-x0y0w1280h720.jpg
// https://images.perthnow.com.au/publication/C-3803742/58387c44af486efc5a26b39ff4a2efd0d6e14c67.jpg
return src.replace(/-16x9-x[0-9]+y[0-9]+w[0-9]+h[0-9]+\./, ".");
// thanks to anonymous for reporting:
// https://images.perthnow.com.au/publication/C-14821277/ad14bd4dfda7c6d05c849ff217e4a304f69a9e9d-161x229-x0y0w2583h3674.jpg
// https://images.perthnow.com.au/publication/C-14821277/ad14bd4dfda7c6d05c849ff217e4a304f69a9e9d.jpg
return src.replace(/-[0-9]+x[0-9]+-x[0-9]+y[0-9]+w[0-9]+h[0-9]+\./, ".");
}

if (domain === "static.metacritic.com") {
Expand Down Expand Up @@ -110089,7 +110141,13 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://cdn.hmv.com/r/w-1280/p-webp/hmv/files/e9/e9346824-4fb7-4fdd-b5df-9462dcc78294.jpg
// https://cdn.hmv.com/r/p-webp/hmv/files/e9/e9346824-4fb7-4fdd-b5df-9462dcc78294.jpg
return src.replace(/\/r\/+.*?\/+(p-[a-z]+)\/+/, "/r/$1/");
// https://hmv.com/getattachment/e9346824-4fb7-4fdd-b5df-9462dcc78294/a.jpg
// https://cdn.hmv.com/r/w-640/hmv/files/54/54d69aea-c9ac-4e77-8ba2-7be88708a8d2.jpg
// https://hmv.com/getattachment/54d69aea-c9ac-4e77-8ba2-7be88708a8d2/a.jpg
// other:
// https://hmv.com/getmedia/61842e9a-0208-4d00-96a6-cf5cef8382b8/KENJI-30-Coupon_feature_panel.jpg
return src.replace(/^[a-z]+:\/\/[^/]+\/+r\/.*?\/hmv\/+files\/+[0-9a-f]{2}\/+([-0-9a-f]{10,})(\.[a-z]+)(?:[?#].*)?$/, "https://hmv.com/getattachment/$1/a$2");
//return src.replace(/\/r\/+.*?\/+(p-[a-z]+)\/+/, "/r/$1/");
}

if (domain_nowww === "ososedki.com") {
Expand Down Expand Up @@ -114247,6 +114305,10 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://trustnordisk.com/fileadmin/_processed_/f/8/csm_Hovedstill_Mr._Freeman_Zentropa_Foto_Christian_Geisnaes__2000x1200__d8dd7379aa.jpg
// https://trustnordisk.com/fileadmin/user_upload/Hovedstill_Mr._Freeman_Zentropa_Foto_Christian_Geisnaes__2000x1200_.jpg
// doesn't work for all:
// thanks to anonymous for reporting:
// https://www.aidlingen.de/fileadmin/_processed_/3/1/csm_RathausPlatz_20b9fa4b72.jpg
// https://www.aidlingen.de/fileadmin/user_upload/RathausPlatz.jpg -- 404
return src.replace(/(\/fileadmin\/+)_processed_\/+(?:[0-9a-f]\/+){2}csm_([^/]+)_[0-9a-f]+\./, "$1user_upload/$2.");
}

Expand Down Expand Up @@ -114392,6 +114454,59 @@ var $$IMU_EXPORT$$;
return src.replace(/(\/product\/+[0-9]+\/+[0-9]+\/+[0-9]+)_[0-9]+_[0-9]+\./, "$1_max.");
}

if (domain_nowww === "chicos.com" && /\/Product_Images\//i.test(src)) {
// thanks to anonymous for reporting:
// https://www.chicos.com/Product_Images/570366113_791.jpg?imgPolicy=productSmall
// https://www.chicos.com/Product_Images/570366113_791_large.jpg
newsrc = src.replace(/[?#].*/, "");
if (newsrc !== src)
return newsrc;

return src.replace(/(\/Product_Images\/+[0-9]+_[0-9]+)(\.[a-z]+)$/i, "$1_large$2");
}

if (domain === "static.zara.net") {
// thanks to anonymous for reporting:
// https://static.zara.net/assets/public/9e67/ed99/6229482faa83/8f197844cd8c/02553498800-200-e1/02553498800-200-e1.jpg?ts=1710949632815&w=422
// https://static.zara.net/assets/public/9e67/ed99/6229482faa83/8f197844cd8c/02553498800-200-e1/02553498800-200-e1.jpg
return src.replace(/(\/assets\/+public\/+.*?)(?:[?#].*)?$/, "$1");
}

if (domain_nowww === "diaart.org") {
// thanks to anonymous for reporting:
// https://www.diaart.org/media/w330h330/pressimages/beacon-exterior-shot-15-photo-bill-jacobson-june-2016.jpg
// https://www.diaart.org/media/_source/pressimages/beacon-exterior-shot-15-photo-bill-jacobson-june-2016.jpg
// https://diaart.org/media/w1050h700/webimages/bourgeois%2018.jpg
// https://diaart.org/media/_source/webimages/bourgeois%2018.jpg
return src.replace(/(\/media\/+)[^/]+\/+([a-z]+images\/+)/, "$1_source/$2");
}

if (domain === "imageservice.disco.peacocktv.com") {
// thanks to anonymous for reporting:
// https://imageservice.disco.peacocktv.com/uuid/ff8fab29-7d11-3812-a58b-be4b64f6fc5e/LAND_16_9/400?language=eng&territory=US&version=47eb3ad9-46f2-314d-8919-5d69acd4962d&image-format=webp&image-quality=7&image-format=webp
// https://imageservice.disco.peacocktv.com/uuid/ff8fab29-7d11-3812-a58b-be4b64f6fc5e/LAND_16_9/400?language=eng&territory=US&version=47eb3ad9-46f2-314d-8919-5d69acd4962d&image-format=png
newsrc = add_queries(remove_queries(src, ["image-format", "image-quality"]), {"image-format": "png"});
if (newsrc !== src)
return newsrc;

// https://imageservice.disco.peacocktv.com/uuid/ff8fab29-7d11-3812-a58b-be4b64f6fc5e/LAND_16_9/400?language=eng&territory=US&version=47eb3ad9-46f2-314d-8919-5d69acd4962d&image-format=png
// https://imageservice.disco.peacocktv.com/uuid/ff8fab29-7d11-3812-a58b-be4b64f6fc5e/LAND_16_9/0?language=eng&territory=US&version=47eb3ad9-46f2-314d-8919-5d69acd4962d&image-format=png -- 1920x1080
// https://imageservice.disco.peacocktv.com/uuid/314e8aac-d98e-3627-bce8-d23baadbd15d/TITLE_ART_3_4/414/552?language=eng&territory=US&proposition=NBCUOTT&version=b335f386-88cc-3e60-a874-2acb42a05402
// https://imageservice.disco.peacocktv.com/uuid/314e8aac-d98e-3627-bce8-d23baadbd15d/TITLE_ART_3_4/0?language=eng&territory=US&proposition=NBCUOTT&version=b335f386-88cc-3e60-a874-2acb42a05402&image-format=png -- 2160x2880
// https://imageservice.disco.peacocktv.com/pcms/232f6028-1399-11ef-afbb-3bc20e2d170b/LAND_16_9/640/480?proposition=NBCUOTT&language=eng&versionId=bfb8ca13-2c6f-54b7-a7ea-7da001a7cd62&territory=US&image-format=png
// https://imageservice.disco.peacocktv.com/pcms/232f6028-1399-11ef-afbb-3bc20e2d170b/LAND_16_9/0?proposition=NBCUOTT&language=eng&versionId=bfb8ca13-2c6f-54b7-a7ea-7da001a7cd62&territory=US&image-format=png -- 3840x2160
// https://imageservice.disco.peacocktv.com/pcms/232f6028-1399-11ef-afbb-3bc20e2d170b/LAND_16_9?proposition=NBCUOTT&language=eng&versionId=bfb8ca13-2c6f-54b7-a7ea-7da001a7cd62&territory=US&image-format=png -- 3840x2160
// todo:
// https://imageservice.disco.peacocktv.com/logo/skychb_6559054711524489117_darknow/LOGO_NON_PADDED/600/208?proposition=NBCUOTT&territory=US&image-format=png
newsrc = src.replace(/(\/(?:uuid|pcms)\/+[-0-9a-f]{10,}\/+[^/]+\/+)[0-9]+(?:\/+[0-9]+)?(\?.*)$/, "$10$2");
if (newsrc !== src)
return newsrc;

// other:
// https://imageservice.disco.peacocktv.com/uuid/144e7f31-a4cb-392d-b405-98052713903f/16-9?sid=6979268080554005117&language=eng&territory=US&version=92f05219-7e27-3578-9e96-b2435fab1e5f&image-format=png
// https://imageservice.disco.peacocktv.com/uuid/7efb7c40-42fe-35e6-a94b-a0c58e912d73/TITLE_TREATMENT?language=eng&territory=US&proposition=NBCUOTT&version=de62b65e-457c-3d3f-9e0b-5828889fc3fe&image-format=png
}




Expand Down
Loading

0 comments on commit b0a03b2

Please sign in to comment.