diff --git a/src/userscript.ts b/src/userscript.ts index 7ae74cbb..d0265ac1 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -24896,11 +24896,17 @@ var $$IMU_EXPORT$$; header += get_attrib("mediaPresentationDuration", "PT" + hours + "H" + minutes + "M" + seconds + "S"); } + if (data.min_buffer_time) { + header += get_attrib("minBufferTime", data.min_buffer_time); + } + header += " profiles=\"urn:mpeg:dash:profile:isoff-main:2011\""; //header += " profiles=\"urn:mpeg:dash:profile:isoff-on-demand:2011\""; header += ">\n\n"; var get_range_str = function(range) { + if (typeof range === "string") + return range; return range.start + "-" + range.end; } @@ -24913,6 +24919,12 @@ var $$IMU_EXPORT$$; rep += get_attrib("width", representation.width); rep += get_attrib("height", representation.height); rep += get_attrib("id", representation.id); + if ("frame_rate" in representation) + rep += get_attrib("frameRate", representation.frame_rate); + if ("start_with_sap" in representation) + rep += get_attrib("startWithSap", representation.start_with_sap); + if ("sar" in representation) + rep += get_attrib("sar", representation.sar); rep += ">\n"; rep += " " + encode_entities(representation.url) + "\n"; @@ -46561,7 +46573,7 @@ var $$IMU_EXPORT$$; // https://img.kiwi/images/2024/01/14/b5331815bc160dc4c0c4eb160107a49c.th.jpg // https://img.kiwi/images/2024/01/14/b5331815bc160dc4c0c4eb160107a49c.jpg domain_nowww === "img.kiwi" || - // thanks to hosadokha on github: https://github.com/qsniyg/maxurl/issues/1269 + // thanks to hosadokha on github for reporting: https://github.com/qsniyg/maxurl/issues/1269 // https://add.pics/images/2020/05/07/ScreenShot_20200507200118.md.png // https://add.pics/images/2020/05/07/ScreenShot_20200507200118.png domain_nowww === "add.pics" || @@ -102486,7 +102498,10 @@ var $$IMU_EXPORT$$; // thanks to Noodlers on discord: // https://matrix-client.matrix.org/_matrix/media/r0/thumbnail/matrix.org/2021-05-19_hcVvTKCeROYgekNO?width=100&height=100&method=scale // https://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/2021-05-19_hcVvTKCeROYgekNO - return src.replace(/(\/_matrix\/+media\/+r[0-9]+\/+)thumbnail\/+([^/]+\/+[-_a-zA-Z0-9]+)\?.*$/, "$1download/$2"); + // thanks to anonymous for reporting: + // https://matrix-client.matrix.org/_matrix/media/v3/thumbnail/matrix.org/cuiuRlBNwdRvVArdiJxgHRgY?width=4096&height=4096&method=crop + // https://matrix-client.matrix.org/_matrix/media/v3/download/matrix.org/cuiuRlBNwdRvVArdiJxgHRgY + return src.replace(/(\/_matrix\/+media\/+(?:r[0-9]+|v3)\/+)thumbnail\/+([^/]+\/+[-_a-zA-Z0-9]+)\?.*$/, "$1download/$2"); } if (domain_nowww === "pornssd.com") { @@ -111745,6 +111760,112 @@ var $$IMU_EXPORT$$; return src.replace(/(_v-variant)[^/.]+\./, "$1Big1xN."); } + if (amazon_container === "acmi-website-media-prod") { + // thanks to anonymous for reporting: + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/181205-0452-ACMI_Cleverman.2e16d0ba.fill-846x476.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/181205-0452-ACMI_Cleverman.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/AI_and_Art_talk_-_web.width-2880.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/AI_and_Art_talk_-_web.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/Shannon_McGrath_BKK_ACMI_smg_0174.max-525x525.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/Shannon_McGrath_BKK_ACMI_smg_0174.jpg + // doesn't work for all: + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/Peacock_magic_lantern_slide_projec.2e16d0ba.fill-846x476.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/Peacock_magic_lantern_slide_projec.jpg -- 403 + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/grad_hp_-_Evolver_by_Marshmallow_Laser_Feast_Wo.original.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/grad_hp_-_Evolver_by_Marshmallow_Laser_Feast_Wo.jpg -- 403 + // other: + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/Film_over_lightbox_-_hero_image.original.jpg -- 2160x1023 + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/Film_over_lightbox_-_hero_image.jpg -- 2160x1023, more saturated + return src.replace(/(\/media\/+)images\/+([^/]+?)(?:\.(?:2e16d0ba|(?:fill|max)-[0-9]+x[0-9]+|width-[0-9]+))+\./, "$1original_images/$2."); + } + + if (host_domain_nosub === "finalfantasyxiv.com" && options.element) { + // thanks to anonymous for reporting: + // https://na.finalfantasyxiv.com/dawntrail/media/#artworks + if (options.element.tagName === "IMG" && options.element.hasAttribute("data-original") && + options.element.parentElement && options.element.parentElement.tagName === "A" && options.element.parentElement.classList.contains("js__media")) { + return options.element.parentElement.href; + } + } + + if (domain === "sites.wrk.ru" || + // http://www.balancer.ru/cache/sites/w/w/www.ljplus.ru/img4/v/l/vladlend/128x128(up,crop)/konkurentiA.jpg + // https://www.ljplus.ru/img4/v/l/vladlend/konkurentiA.jpg + domain_nowww === "balancer.ru") { + // https://sites.wrk.ru/cache/sites/w/w/www.ljplus.ru/img/f/i/first_nah/128x128(up,crop)/debaty.JPG + // https://www.ljplus.ru/img/f/i/first_nah/debaty.JPG + // https://sites.wrk.ru/cache/sites/w/w/www.ljplus.ru/img4/i/_/i_korotchenko/128x128-crop/RLS_1_.jpg + // https://www.ljplus.ru/img4/i/_/i_korotchenko/RLS_1_.jpg + // https://sites.wrk.ru/cache/sites/r/u/russianplanes.net/images/to36000/640x/035589.jpg + // https://russianplanes.net/images/to36000/035589.jpg + // http://balancer.ru/cache/sites/l/j/ljplus.ru/img/m/u/muxel/468x468/5V61.jpg + // https://ljplus.ru/img/m/u/muxel/5V61.jpg + return src.replace(/^[a-z]+:\/\/[^/]+\/+cache\/+sites\/+.\/+.\/+([^/]+\.[^/]+\/.*?)\/[0-9]+x[0-9]*(?:\([^/]+\)|-[a-z]+)?\/+([^/]+)(?:[?#].*)?$/, "http://$1/$2"); + } + + if (domain_nowww === "bilibili.com") { + // https://www.bilibili.com/video/BV11t421H7bz/?spm_id_from=333.1073.high_energy.content.click + newsrc = website_query({ + website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([A-Za-z0-9]+)\/*(?:[?#].*)?$/, + query_for_id: "https://www.bilibili.com/video/${id}/", + process: function(done, resp, cache_key) { + let match = resp.responseText.match(/__playinfo__\s*=\s*({.*?})<\/script/); + if (!match) { + console_error(cache_key, "Unable to find playinfo match for", resp); + return done(null, false); + } + + let json = JSON_parse(match[1]); + let dashsource = json.data.dash; + + let dashdata = {mimes: {}}; + + let add_source = function(src) { + let formatdash = { + url: src.baseUrl, + width: src.width, + height: src.height, + bandwidth: src.bandwidth, + id: src.id, + init_range: src.SegmentBase.Initialization, + index_range: src.SegmentBase.indexRange, + mime: src.mime_type, + codecs: src.codecs, + start_with_sap: src.startWithSap, + frame_rate: src.frameRate, + sar: src.sar + }; + + if (!(src.mime_type in dashdata.mimes)) { + dashdata.mimes[src.mime_type] = []; + } + + dashdata.mimes[src.mime_type].push(formatdash); + }; + + for (let src of dashsource.video) { + add_source(src); + } + + for (let src of dashsource.audio) { + add_source(src); + } + + dashdata.duration = dashsource.duration; + dashdata.min_buffer_time = dashsource.minBufferTime; + + let dash = common_functions["create_dash_stream"](dashdata); + let dashurl = "data:application/dash+xml," + encodeURIComponent(dash); + + return done({ + url: dashurl, + video: "dash" + }, 60*60); + } + }); + if (newsrc) return newsrc; + } + diff --git a/userscript.user.js b/userscript.user.js index b91434e2..0f075e86 100644 --- a/userscript.user.js +++ b/userscript.user.js @@ -22843,10 +22843,15 @@ var $$IMU_EXPORT$$; var seconds = data.duration % 60; header += get_attrib("mediaPresentationDuration", "PT" + hours + "H" + minutes + "M" + seconds + "S"); } + if (data.min_buffer_time) { + header += get_attrib("minBufferTime", data.min_buffer_time); + } header += " profiles=\"urn:mpeg:dash:profile:isoff-main:2011\""; //header += " profiles=\"urn:mpeg:dash:profile:isoff-on-demand:2011\""; header += ">\n\n"; var get_range_str = function(range) { + if (typeof range === "string") + return range; return range.start + "-" + range.end; }; var create_representation = function(representation) { @@ -22857,6 +22862,12 @@ var $$IMU_EXPORT$$; rep += get_attrib("width", representation.width); rep += get_attrib("height", representation.height); rep += get_attrib("id", representation.id); + if ("frame_rate" in representation) + rep += get_attrib("frameRate", representation.frame_rate); + if ("start_with_sap" in representation) + rep += get_attrib("startWithSap", representation.start_with_sap); + if ("sar" in representation) + rep += get_attrib("sar", representation.sar); rep += ">\n"; rep += " " + encode_entities(representation.url) + "\n"; if (representation.index_range || representation.init_range) { @@ -42502,7 +42513,7 @@ var $$IMU_EXPORT$$; // https://img.kiwi/images/2024/01/14/b5331815bc160dc4c0c4eb160107a49c.th.jpg // https://img.kiwi/images/2024/01/14/b5331815bc160dc4c0c4eb160107a49c.jpg domain_nowww === "img.kiwi" || - // thanks to hosadokha on github: https://github.com/qsniyg/maxurl/issues/1269 + // thanks to hosadokha on github for reporting: https://github.com/qsniyg/maxurl/issues/1269 // https://add.pics/images/2020/05/07/ScreenShot_20200507200118.md.png // https://add.pics/images/2020/05/07/ScreenShot_20200507200118.png domain_nowww === "add.pics" || @@ -91958,7 +91969,10 @@ var $$IMU_EXPORT$$; // thanks to Noodlers on discord: // https://matrix-client.matrix.org/_matrix/media/r0/thumbnail/matrix.org/2021-05-19_hcVvTKCeROYgekNO?width=100&height=100&method=scale // https://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/2021-05-19_hcVvTKCeROYgekNO - return src.replace(/(\/_matrix\/+media\/+r[0-9]+\/+)thumbnail\/+([^/]+\/+[-_a-zA-Z0-9]+)\?.*$/, "$1download/$2"); + // thanks to anonymous for reporting: + // https://matrix-client.matrix.org/_matrix/media/v3/thumbnail/matrix.org/cuiuRlBNwdRvVArdiJxgHRgY?width=4096&height=4096&method=crop + // https://matrix-client.matrix.org/_matrix/media/v3/download/matrix.org/cuiuRlBNwdRvVArdiJxgHRgY + return src.replace(/(\/_matrix\/+media\/+(?:r[0-9]+|v3)\/+)thumbnail\/+([^/]+\/+[-_a-zA-Z0-9]+)\?.*$/, "$1download/$2"); } if (domain_nowww === "pornssd.com") { match = src.match(/\/wp-content\/+plugins\/+clean-tube-player\/+public\/+player-x.php\?q=([^&]{50,})/); @@ -100295,6 +100309,101 @@ var $$IMU_EXPORT$$; // https://cdn.mdr.de/nachrichten/sachsen/flugzeug-abfertiger-102-resimage_v-variantBig1xN.jpg return src.replace(/(_v-variant)[^/.]+\./, "$1Big1xN."); } + if (amazon_container === "acmi-website-media-prod") { + // thanks to anonymous for reporting: + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/181205-0452-ACMI_Cleverman.2e16d0ba.fill-846x476.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/181205-0452-ACMI_Cleverman.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/AI_and_Art_talk_-_web.width-2880.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/AI_and_Art_talk_-_web.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/Shannon_McGrath_BKK_ACMI_smg_0174.max-525x525.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/Shannon_McGrath_BKK_ACMI_smg_0174.jpg + // doesn't work for all: + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/Peacock_magic_lantern_slide_projec.2e16d0ba.fill-846x476.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/Peacock_magic_lantern_slide_projec.jpg -- 403 + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/grad_hp_-_Evolver_by_Marshmallow_Laser_Feast_Wo.original.jpg + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/grad_hp_-_Evolver_by_Marshmallow_Laser_Feast_Wo.jpg -- 403 + // other: + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/images/Film_over_lightbox_-_hero_image.original.jpg -- 2160x1023 + // https://acmi-website-media-prod.s3.ap-southeast-2.amazonaws.com/media/original_images/Film_over_lightbox_-_hero_image.jpg -- 2160x1023, more saturated + return src.replace(/(\/media\/+)images\/+([^/]+?)(?:\.(?:2e16d0ba|(?:fill|max)-[0-9]+x[0-9]+|width-[0-9]+))+\./, "$1original_images/$2."); + } + if (host_domain_nosub === "finalfantasyxiv.com" && options.element) { + // thanks to anonymous for reporting: + // https://na.finalfantasyxiv.com/dawntrail/media/#artworks + if (options.element.tagName === "IMG" && options.element.hasAttribute("data-original") && + options.element.parentElement && options.element.parentElement.tagName === "A" && options.element.parentElement.classList.contains("js__media")) { + return options.element.parentElement.href; + } + } + if (domain === "sites.wrk.ru" || + // http://www.balancer.ru/cache/sites/w/w/www.ljplus.ru/img4/v/l/vladlend/128x128(up,crop)/konkurentiA.jpg + // https://www.ljplus.ru/img4/v/l/vladlend/konkurentiA.jpg + domain_nowww === "balancer.ru") { + // https://sites.wrk.ru/cache/sites/w/w/www.ljplus.ru/img/f/i/first_nah/128x128(up,crop)/debaty.JPG + // https://www.ljplus.ru/img/f/i/first_nah/debaty.JPG + // https://sites.wrk.ru/cache/sites/w/w/www.ljplus.ru/img4/i/_/i_korotchenko/128x128-crop/RLS_1_.jpg + // https://www.ljplus.ru/img4/i/_/i_korotchenko/RLS_1_.jpg + // https://sites.wrk.ru/cache/sites/r/u/russianplanes.net/images/to36000/640x/035589.jpg + // https://russianplanes.net/images/to36000/035589.jpg + // http://balancer.ru/cache/sites/l/j/ljplus.ru/img/m/u/muxel/468x468/5V61.jpg + // https://ljplus.ru/img/m/u/muxel/5V61.jpg + return src.replace(/^[a-z]+:\/\/[^/]+\/+cache\/+sites\/+.\/+.\/+([^/]+\.[^/]+\/.*?)\/[0-9]+x[0-9]*(?:\([^/]+\)|-[a-z]+)?\/+([^/]+)(?:[?#].*)?$/, "http://$1/$2"); + } + if (domain_nowww === "bilibili.com") { + // https://www.bilibili.com/video/BV11t421H7bz/?spm_id_from=333.1073.high_energy.content.click + newsrc = website_query({ + website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([A-Za-z0-9]+)\/*(?:[?#].*)?$/, + query_for_id: "https://www.bilibili.com/video/${id}/", + process: function(done, resp, cache_key) { + var match = resp.responseText.match(/__playinfo__\s*=\s*({.*?})<\/script/); + if (!match) { + console_error(cache_key, "Unable to find playinfo match for", resp); + return done(null, false); + } + var json = JSON_parse(match[1]); + var dashsource = json.data.dash; + var dashdata = { mimes: {} }; + var add_source = function(src) { + var formatdash = { + url: src.baseUrl, + width: src.width, + height: src.height, + bandwidth: src.bandwidth, + id: src.id, + init_range: src.SegmentBase.Initialization, + index_range: src.SegmentBase.indexRange, + mime: src.mime_type, + codecs: src.codecs, + start_with_sap: src.startWithSap, + frame_rate: src.frameRate, + sar: src.sar + }; + if (!(src.mime_type in dashdata.mimes)) { + dashdata.mimes[src.mime_type] = []; + } + dashdata.mimes[src.mime_type].push(formatdash); + }; + for (var _i = 0, _a = dashsource.video; _i < _a.length; _i++) { + var src_2 = _a[_i]; + add_source(src_2); + } + for (var _b = 0, _c = dashsource.audio; _b < _c.length; _b++) { + var src_3 = _c[_b]; + add_source(src_3); + } + dashdata.duration = dashsource.duration; + dashdata.min_buffer_time = dashsource.minBufferTime; + var dash = common_functions["create_dash_stream"](dashdata); + var dashurl = "data:application/dash+xml," + encodeURIComponent(dash); + return done({ + url: dashurl, + video: "dash" + }, 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 @@ -112053,10 +112162,10 @@ var $$IMU_EXPORT$$; } } if (el_tagname === "A" || (settings.mouseover_allow_iframe_el && el_tagname === "IFRAME")) { - var src_2 = get_img_src(el); - links[src_2] = { + var src_4 = get_img_src(el); + links[src_4] = { count: 1, - src: src_2, + src: src_4, el: el, id: id++ };