url: make youtu.be alias rule more lax

This commit is contained in:
dumbmoron 2023-12-12 23:19:01 +00:00
parent 2e1eb1b864
commit 149c16abbb
No known key found for this signature in database
GPG key ID: C59997C76C6A8E5F

View file

@ -17,7 +17,7 @@ export function aliasURL(url) {
}
break;
case "youtu":
if (url.hostname === 'youtu.be' && parts.length === 2) {
if (url.hostname === 'youtu.be' && parts.length >= 2) {
/* youtu.be urls can be weird, e.g. https://youtu.be/<id>//asdasd// still works
** but we only care about the 1st segment of the path */
url = new URL(`https://youtube.com/watch?v=${