[invidio_proxy_mode.user] fix when live URL exists
This commit is contained in:
parent
895b3facb4
commit
79df316f8b
@ -22,15 +22,23 @@
|
||||
const consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1px solid #00FF00; line-height: 16px;';
|
||||
|
||||
// Set variables
|
||||
let i, j;
|
||||
let i, j, url;
|
||||
let vids_tags = ["video", "source"];
|
||||
let vids_elements, proxyURL;
|
||||
|
||||
// Regex
|
||||
let params=new RegExp(/(^itag=22|itag=43|itag=18)$/);
|
||||
|
||||
for (i = 0; i < vids_tags.length; i++) {
|
||||
vids_elements = document.getElementsByTagName(vids_tags[i]);
|
||||
for (j = 0; j < vids_elements.length; j++) {
|
||||
proxyURL = vids_elements.item(j).src + "&local=true";
|
||||
vids_elements.item(j).src = proxyURL;
|
||||
url = vids_elements.item(j).src;
|
||||
if(params.test(url)) {
|
||||
proxyURL = url + "&local=true";
|
||||
vids_elements.item(j).src = proxyURL;
|
||||
} else {
|
||||
console.log('Live URL or format M3U8');
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log("%cUSERSCRIPT | " + GM_info.script.name + " " + GM_info.script.version + " | successfully initialized", consoleCSS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user