mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-18 06:09:58 +00:00
url: remove tumblr aliasing
not quite sure what its purpose is/was anyways (tracking id removal? it's not used anyways)
This commit is contained in:
parent
0244c40d0b
commit
3a00bc7f8d
1 changed files with 1 additions and 9 deletions
|
@ -12,7 +12,7 @@ export function aliasURL(url) {
|
||||||
case "youtube":
|
case "youtube":
|
||||||
if (url.pathname.startsWith('/live/') || url.pathname.startsWith('/shorts/')) {
|
if (url.pathname.startsWith('/live/') || url.pathname.startsWith('/shorts/')) {
|
||||||
url.pathname = '/watch';
|
url.pathname = '/watch';
|
||||||
// ['', 'live' || 'shorts', id, ...rest]
|
// parts := ['', 'live' || 'shorts', id, ...rest]
|
||||||
url.search = `?v=${encodeURIComponent(parts[2])}`
|
url.search = `?v=${encodeURIComponent(parts[2])}`
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -33,14 +33,6 @@ export function aliasURL(url) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "tumblr":
|
|
||||||
if (!url.pathname.includes("/blog/view")) {
|
|
||||||
if (url.pathname.endsWith('/'))
|
|
||||||
url.pathname = url.pathname.slice(0, -1);
|
|
||||||
url.pathname = url.pathname.replace(parts[5], '')
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "twitch":
|
case "twitch":
|
||||||
if (url.hostname === 'clips.twitch.tv' && parts.length >= 2) {
|
if (url.hostname === 'clips.twitch.tv' && parts.length >= 2) {
|
||||||
url = new URL(`https://twitch.tv/_/clip/${parts[1]}`);
|
url = new URL(`https://twitch.tv/_/clip/${parts[1]}`);
|
||||||
|
|
Loading…
Reference in a new issue