mirror of
https://github.com/SinTan1729/userscripts.git
synced 2025-02-05 14:12:32 -06:00
feat: Tag for temporarily disabling piped forwarding
This commit is contained in:
parent
b4d9207ff4
commit
56776d7e7c
1 changed files with 8 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name YouTube2Piped
|
// @name YouTube2Piped
|
||||||
// @namespace YouTube
|
// @namespace YouTube
|
||||||
// @version 1.3.0
|
// @version 1.4.0
|
||||||
// @description Redirect YouTube to chosen Piped instance
|
// @description Redirect YouTube to chosen Piped instance
|
||||||
// @author SinTan
|
// @author SinTan
|
||||||
// @match *://*.youtube.com/*
|
// @match *://*.youtube.com/*
|
||||||
|
@ -14,10 +14,15 @@
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
if (location.href.endsWith('#no-piped')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Edit instance url here to go to any instance of choice
|
// Edit instance url here to go to any instance of choice
|
||||||
const instance = "https://piped.video";
|
const instance = "https://piped.video";
|
||||||
|
|
||||||
const url = new URL(window.location.href.replace('/shorts/','/watch?v='));
|
const url = new URL(window.location.href.replace('/shorts/', '/watch?v='));
|
||||||
let url_new = null;
|
let url_new = null;
|
||||||
|
|
||||||
let id = url.searchParams.get('v');
|
let id = url.searchParams.get('v');
|
||||||
|
@ -54,4 +59,4 @@
|
||||||
window.location.replace(url_new);
|
window.location.replace(url_new);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)();
|
)();
|
Loading…
Reference in a new issue