Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
Fixes #1263
  • Loading branch information
qsniyg committed Jan 25, 2024
1 parent 63d9ce6 commit f02212d
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Improvements:

* Various improvements/fixes to existing rules

Special thanks to Froktime for their contributions and reports for this release
Special thanks to Froktime, aslian for their contributions and reports for this release

---

Expand Down
59 changes: 56 additions & 3 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32624,6 +32624,9 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://nouwcdn.com/v201/u/44/1353044/419/201908221517070611.jpg?version=202007&width=700
domain_nowww === "nouwcdn.com" ||
// thanks to anonymous for reporting:
// https://eh96lnrmau.user-space.cdn.idcfcloud.net/thumbnail/book/1897.jpg?auto=webp&width=750
domain === "eh96lnrmau.user-space.cdn.idcfcloud.net" ||
// 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 @@ -35037,12 +35040,27 @@ var $$IMU_EXPORT$$;
return src.replace(/[0-9]*_[0-9]*(\.[^/.]*)$/, "0_0$1");
}

if (domain_nosub === "duitang.com") {
if (domain_nosub === "duitang.com" || domain_nosub === "dtstatic.com") {
// https://b-ssl.duitang.com/uploads/item/201508/01/20150801214854_2Vr53.thumb.700_0.jpeg -- 403
// https://b-ssl.duitang.com/uploads/item/201508/01/20150801214854_2Vr53.jpeg -- works
// https://c-ssl.duitang.com/uploads/item/201808/08/20180808195029_brxev.thumb.400_0.jpg
// https://c-ssl.duitang.com/uploads/item/201808/08/20180808195029_brxev.jpg
return src.replace(/(\/uploads\/+item\/+.*)\.thumb\.[0-9]+_[0-9]+\./, "$1.");
// thanks to aslian on github: https://github.com/qsniyg/maxurl/pull/1263
// https://c-ssl.dtstatic.com/uploads/people/201502/06/20150206101745_EFwrX.thumb.100_100_c.jpeg
// https://c-ssl.dtstatic.com/uploads/people/201502/06/20150206101745_EFwrX.jpeg
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.jpeg_webp
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.jpeg
// https://c-ssl.dtstatic.com/uploads/blog/202312/20/GgSl4lahdzLw8b.thumb.400_0.png
// https://c-ssl.dtstatic.com/uploads/blog/202312/20/GgSl4lahdzLw8b.png
// https://c-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.thumb.1000_0.jpeg
// https://c-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.jpeg
// https://d-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.thumb.300_300_c.jpeg_webp
// https://d-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.jpeg
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.thumb.300_300_c.jpeg_webp
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.jpeg
return src
.replace(/(\.[a-z]+)_webp(?:[?#].*)?$/, "$1")
.replace(/(\/uploads\/+[^/]+\/+.*)\.thumb\.[0-9]+_[0-9]+(?:_c)?\./, "$1.");
}

if (domain_nosub === "vcimg.com" &&
Expand Down Expand Up @@ -111254,7 +111272,7 @@ var $$IMU_EXPORT$$;
filename: item.name
};

let mime = item.mimetime || "";
let mime = item.mimetype || "";
if (/^video\//.test(mime))
obj.video = true;
else if (!/^(?:image|audio)\//.test(mime)) {
Expand Down Expand Up @@ -111406,6 +111424,41 @@ var $$IMU_EXPORT$$;
return src.replace(/(\/movie\/+card\/+[0-9]+\/+)thumb\/+([^/]+)(?:[?#].*)?$/, "$1large/$2");
}

if (domain_nowww === "kick.com") {
let query_kick_video_api = function(vidid, cb) {
let cache_key = "kick_video:" + vidid;
api_query(cache_key, {
url: "https://kick.com/api/v1/video/" + vidid,
imu_mode: "xhr",
json: true
}, cb, function(done, resp, cache_key) {
if (!resp)
return done(null, false);

let obj:BigImageInfoSObject = {
url: resp.source,
video: "hls",
extra: {
created_date: new Date(resp.livestream.start_time).getTime(),
page: "https://kick.com/video/" + vidid,
caption: resp.livestream.session_title
}
};

return done(obj, 6*60*60);
});
};

// thanks to anonymous for reporting:
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([-0-9a-f]{10,})(?:[?#].*)?$/,
run: function(cb, match) {
query_kick_video_api(match[1], cb);
}
});
if (newsrc) return newsrc;
}




Expand Down
56 changes: 53 additions & 3 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -29812,6 +29812,9 @@ var $$IMU_EXPORT$$;
// thanks to anonymous for reporting:
// https://nouwcdn.com/v201/u/44/1353044/419/201908221517070611.jpg?version=202007&width=700
domain_nowww === "nouwcdn.com" ||
// thanks to anonymous for reporting:
// https://eh96lnrmau.user-space.cdn.idcfcloud.net/thumbnail/book/1897.jpg?auto=webp&width=750
domain === "eh96lnrmau.user-space.cdn.idcfcloud.net" ||
// 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 @@ -32094,12 +32097,27 @@ var $$IMU_EXPORT$$;
if (domain.search(/mp[0-9]*\.qiyipic\.com/) >= 0 && string_indexof(src, "/passport/") < 0) {
return src.replace(/[0-9]*_[0-9]*(\.[^/.]*)$/, "0_0$1");
}
if (domain_nosub === "duitang.com") {
if (domain_nosub === "duitang.com" || domain_nosub === "dtstatic.com") {
// https://b-ssl.duitang.com/uploads/item/201508/01/20150801214854_2Vr53.thumb.700_0.jpeg -- 403
// https://b-ssl.duitang.com/uploads/item/201508/01/20150801214854_2Vr53.jpeg -- works
// https://c-ssl.duitang.com/uploads/item/201808/08/20180808195029_brxev.thumb.400_0.jpg
// https://c-ssl.duitang.com/uploads/item/201808/08/20180808195029_brxev.jpg
return src.replace(/(\/uploads\/+item\/+.*)\.thumb\.[0-9]+_[0-9]+\./, "$1.");
// thanks to aslian on github: https://github.com/qsniyg/maxurl/pull/1263
// https://c-ssl.dtstatic.com/uploads/people/201502/06/20150206101745_EFwrX.thumb.100_100_c.jpeg
// https://c-ssl.dtstatic.com/uploads/people/201502/06/20150206101745_EFwrX.jpeg
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.jpeg_webp
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.jpeg
// https://c-ssl.dtstatic.com/uploads/blog/202312/20/GgSl4lahdzLw8b.thumb.400_0.png
// https://c-ssl.dtstatic.com/uploads/blog/202312/20/GgSl4lahdzLw8b.png
// https://c-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.thumb.1000_0.jpeg
// https://c-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.jpeg
// https://d-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.thumb.300_300_c.jpeg_webp
// https://d-ssl.dtstatic.com/uploads/blog/202209/06/20220906131540_249df.jpeg
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.thumb.300_300_c.jpeg_webp
// https://c-ssl.duitang.com/uploads/blog/202209/06/20220906131540_249df.jpeg
return src
.replace(/(\.[a-z]+)_webp(?:[?#].*)?$/, "$1")
.replace(/(\/uploads\/+[^/]+\/+.*)\.thumb\.[0-9]+_[0-9]+(?:_c)?\./, "$1.");
}
if (domain_nosub === "vcimg.com" &&
domain.match(/i-[0-9]\.vcimg.com/)) {
Expand Down Expand Up @@ -99851,7 +99869,7 @@ var $$IMU_EXPORT$$;
},
filename: item.name
};
var mime = item.mimetime || "";
var mime = item.mimetype || "";
if (/^video\//.test(mime))
obj_8.video = true;
else if (!/^(?:image|audio)\//.test(mime)) {
Expand Down Expand Up @@ -99983,6 +100001,38 @@ var $$IMU_EXPORT$$;
// https://www.virtual-history.com/movie/card/16/large/genia_nikolaieva_014.jpg
return src.replace(/(\/movie\/+card\/+[0-9]+\/+)thumb\/+([^/]+)(?:[?#].*)?$/, "$1large/$2");
}
if (domain_nowww === "kick.com") {
var query_kick_video_api_1 = function(vidid, cb) {
var cache_key = "kick_video:" + vidid;
api_query(cache_key, {
url: "https://kick.com/api/v1/video/" + vidid,
imu_mode: "xhr",
json: true
}, cb, function(done, resp, cache_key) {
if (!resp)
return done(null, false);
var obj = {
url: resp.source,
video: "hls",
extra: {
created_date: new Date(resp.livestream.start_time).getTime(),
page: "https://kick.com/video/" + vidid,
caption: resp.livestream.session_title
}
};
return done(obj, 6 * 60 * 60);
});
};
// thanks to anonymous for reporting:
newsrc = website_query({
website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([-0-9a-f]{10,})(?:[?#].*)?$/,
run: function(cb, match) {
query_kick_video_api_1(match[1], cb);
}
});
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 f02212d

Please sign in to comment.