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:
dumbmoron 2023-12-14 23:37:10 +00:00
parent 0244c40d0b
commit 3a00bc7f8d
No known key found for this signature in database
GPG key ID: C59997C76C6A8E5F

View file

@ -12,7 +12,7 @@ export function aliasURL(url) {
case "youtube":
if (url.pathname.startsWith('/live/') || url.pathname.startsWith('/shorts/')) {
url.pathname = '/watch';
// ['', 'live' || 'shorts', id, ...rest]
// parts := ['', 'live' || 'shorts', id, ...rest]
url.search = `?v=${encodeURIComponent(parts[2])}`
}
break;
@ -33,14 +33,6 @@ export function aliasURL(url) {
}
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":
if (url.hostname === 'clips.twitch.tv' && parts.length >= 2) {
url = new URL(`https://twitch.tv/_/clip/${parts[1]}`);