-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathus.js
72 lines (66 loc) · 3.19 KB
/
us.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// The lines below are skipped by the resource parser. Purpose is clean
// jshinting.
(function() {
// >>>> start of private namespace
'use strict';
/// cbs.js
(() => {
window.XMLHttpRequest.prototype.open = new Proxy(window.XMLHttpRequest.prototype.open, {
apply: async (a, b, c) => {
const d = c[1];
return "string" != typeof d || 0 === d.length ? Reflect.apply(a, b, c) : (d.match(/pubads\.g\.doubleclick.net\/ondemand\/hls\/.*\.m3u8/) && b.addEventListener("readystatechange", function() {
if (4 === b.readyState) {
const a = b.response;
Object.defineProperty(b, "response", {
writable: !0
}), Object.defineProperty(b, "responseText", {
writable: !0
});
const c = a.replaceAll(/#EXTINF:(\d|\d\.\d+)\,\nhttps:\/\/redirector\.googlevideo\.com\/videoplayback\?[\s\S]*?&source=dclk_video_ads&[\s\S]*?\n/g, "");
b.response = c, b.responseText = c
}
}), Reflect.apply(a, b, c))
}
})
})();
/// cbs0.js
(() => {
const a = window.fetch;
window.fetch = new Proxy(window.fetch, {
apply: async (b, c, d) => {
const e = d[0];
if ("string" != typeof e || 0 === e.length) return Reflect.apply(b, c, d);
if (e.match(/pubads\.g\.doubleclick\.net\/ondemand\/.*\/content\/.*\/vid\/.*\/streams\/.*\/manifest\.mpd|pubads\.g\.doubleclick.net\/ondemand\/hls\/.*\.m3u8/)) {
const b = await a(...d);
let c = await b.text();
return c = c.replaceAll(/<Period id="(pre|mid|post)-roll-.-ad-[\s\S]*?>[\s\S]*?<\/Period>|#EXTINF:(\d|\d\.\d+)\,\nhttps:\/\/redirector\.googlevideo\.com\/videoplayback\?[\s\S]*?&source=dclk_video_ads&[\s\S]*?\n/g, ""), new Response(c)
}
return Reflect.apply(b, c, d)
}
})
})();
// for nbc.com (filter from Adguard) , player player.theplatform.com
// to be added in "my filters": player.theplatform.com##+js(nbc)
/// nbc.js
(() => {
window.XMLHttpRequest.prototype.open = new Proxy(window.XMLHttpRequest.prototype.open, {
apply: async (a, b, c) => {
const d = c[1];
return "string" != typeof d || 0 === d.length ? Reflect.apply(a, b, c) : (d.match(/manifest\..*\.theplatform\.com\/.*\/.*\.m3u8\?.*|manifest\..*\.theplatform\.com\/.*\/*\.meta.*/) && b.addEventListener("readystatechange", function() {
if (4 === b.readyState) {
const a = b.response;
Object.defineProperty(b, "response", {
writable: !0
}), Object.defineProperty(b, "responseText", {
writable: !0
});
const c = a.replaceAll(/#EXTINF:.*\n.*tvessaiprod\.nbcuni\.com\/video\/[\s\S]*?#EXT-X-DISCONTINUITY|#EXT-X-VMAP-AD-BREAK[\s\S]*?#EXT-X-ENDLIST/g, "");
b.response = c, b.responseText = c
}
}), Reflect.apply(a, b, c))
}
})
})();
// These lines below are skipped by the resource parser.
// <<<< end of private namespace
})();