Skip to content

Commit

Permalink
More websites/rules (fixes #1250)
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Jan 27, 2024
1 parent db9f97d commit a9a4291
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
39 changes: 38 additions & 1 deletion src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42521,7 +42521,12 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://qph.cf2.quoracdn.net/main-qimg-ce650e3cb82159b6042f9c5da845dfc8-lq
// https://qph.cf2.quoracdn.net/main-qimg-ce650e3cb82159b6042f9c5da845dfc8
return src.replace(/(\/main-qimg-[0-9a-f]{10,})-(?:[a-z]|lq)$/, "$1");
// thanks to anonymous for reporting:
// https://qph.cf2.quoracdn.net/main-thumb-787466541-200-pqnwkfwplsapthrxdiswtzkhvpgvdkdv.jpeg
// https://qph.cf2.quoracdn.net/main-raw-787466541-pqnwkfwplsapthrxdiswtzkhvpgvdkdv.jpeg
return src
.replace(/(\/main-)thumb-([0-9]+-)[0-9]+-([a-z]{10,}\.)/, "$1raw-$2$3")
.replace(/(\/main-qimg-[0-9a-f]{10,})-(?:[a-z]|lq)$/, "$1");
}

if (false && domain_nosub === "fan.pw" &&
Expand Down Expand Up @@ -111547,6 +111552,38 @@ var $$IMU_EXPORT$$;
return src.replace(/(\/f\/+[0-9]+\/+.*?\.[a-z]+)\/+m\/.*/, "$1");
}

if (domain === "cdn.verk.net") {
// thanks to anonymous for reporting:
// https://cdn.verk.net/kuvastin/w:816/h:510/rt:fit/q:80/sh:0.5/plain/images/99/2_898681-1920x1080.jpeg
// https://cdn.verk.net/kuvastin/plain/images/99/2_898681-1920x1080.jpeg
return src.replace(/\/(?:[whq]|rt|sh):[^/]+\/+(plain\/+images\/)/, "/$1");
}

if (domain === "image-cdn.spatialest.com") {
// thanks to anonymous for reporting:
// https://property.spatialest.com/nc/pitt#/
// https://image-cdn.spatialest.com/image/nc-pitt-images/sml/photos/.../....jpg
// https://image-cdn.spatialest.com/image/nc-pitt-images/lrg/photos/.../....jpg
return src.replace(/(\/image\/+[^/]+\/+)(?:sml|med)\/+/, "$1lrg/");
}

if (domain === "api.spatialest.com") {
// thanks to anonymous for reporting:
// https://api.spatialest.com/v1/nc/pitt/images-api?id=...&type=photo&size=med
// https://api.spatialest.com/v1/nc/pitt/images-api?size=lrg&id=...&type=photo
if (/\/images-api\?/.test(src)) {
return keep_queries(src, ["size", "id", "type"], {overwrite: {
"size": "lrg"
}});
}
}

if (domain === "images.comico.io") {
// thanks to uwuceo on github: https://github.com/qsniyg/maxurl/issues/1250
// https://images.comico.io/content/en/.../.../.../....jpg/dims/crop/x2000+0+0/optimize?Policy=...&Signature=...&Key-Pair-Id=...
return src.replace(/\/dims\/+[^?#]*([?#].*)?$/, "$1");
}




Expand Down
35 changes: 34 additions & 1 deletion userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -38884,7 +38884,12 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://qph.cf2.quoracdn.net/main-qimg-ce650e3cb82159b6042f9c5da845dfc8-lq
// https://qph.cf2.quoracdn.net/main-qimg-ce650e3cb82159b6042f9c5da845dfc8
return src.replace(/(\/main-qimg-[0-9a-f]{10,})-(?:[a-z]|lq)$/, "$1");
// thanks to anonymous for reporting:
// https://qph.cf2.quoracdn.net/main-thumb-787466541-200-pqnwkfwplsapthrxdiswtzkhvpgvdkdv.jpeg
// https://qph.cf2.quoracdn.net/main-raw-787466541-pqnwkfwplsapthrxdiswtzkhvpgvdkdv.jpeg
return src
.replace(/(\/main-)thumb-([0-9]+-)[0-9]+-([a-z]{10,}\.)/, "$1raw-$2$3")
.replace(/(\/main-qimg-[0-9a-f]{10,})-(?:[a-z]|lq)$/, "$1");
}
if (false && domain_nosub === "fan.pw" &&
string_indexof(src, "/cpg/albums/") >= 0) {
Expand Down Expand Up @@ -100113,6 +100118,34 @@ var $$IMU_EXPORT$$;
// https://img.thecollector.io/f/122649/2000x1500/0fae5dbef2/71799.png
return src.replace(/(\/f\/+[0-9]+\/+.*?\.[a-z]+)\/+m\/.*/, "$1");
}
if (domain === "cdn.verk.net") {
// thanks to anonymous for reporting:
// https://cdn.verk.net/kuvastin/w:816/h:510/rt:fit/q:80/sh:0.5/plain/images/99/2_898681-1920x1080.jpeg
// https://cdn.verk.net/kuvastin/plain/images/99/2_898681-1920x1080.jpeg
return src.replace(/\/(?:[whq]|rt|sh):[^/]+\/+(plain\/+images\/)/, "/$1");
}
if (domain === "image-cdn.spatialest.com") {
// thanks to anonymous for reporting:
// https://property.spatialest.com/nc/pitt#/
// https://image-cdn.spatialest.com/image/nc-pitt-images/sml/photos/.../....jpg
// https://image-cdn.spatialest.com/image/nc-pitt-images/lrg/photos/.../....jpg
return src.replace(/(\/image\/+[^/]+\/+)(?:sml|med)\/+/, "$1lrg/");
}
if (domain === "api.spatialest.com") {
// thanks to anonymous for reporting:
// https://api.spatialest.com/v1/nc/pitt/images-api?id=...&type=photo&size=med
// https://api.spatialest.com/v1/nc/pitt/images-api?size=lrg&id=...&type=photo
if (/\/images-api\?/.test(src)) {
return keep_queries(src, ["size", "id", "type"], { overwrite: {
"size": "lrg"
} });
}
}
if (domain === "images.comico.io") {
// thanks to uwuceo on github: https://github.com/qsniyg/maxurl/issues/1250
// https://images.comico.io/content/en/.../.../.../....jpg/dims/crop/x2000+0+0/optimize?Policy=...&Signature=...&Key-Pair-Id=...
return src.replace(/\/dims\/+[^?#]*([?#].*)?$/, "$1");
}
// -- 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 a9a4291

Please sign in to comment.