forked from Mastodon/mastoradio-la-radio-di-mastodon
add support to mobile youtube subdomain
This commit is contained in:
@ -123,7 +123,7 @@ function mkData(status)
|
|||||||
for (const urlAsString of urls) {
|
for (const urlAsString of urls) {
|
||||||
const url = new URL(urlAsString)
|
const url = new URL(urlAsString)
|
||||||
|
|
||||||
if (['youtube.com', 'music.youtube.com'].includes(url.hostname) && url.searchParams.has('v')) {
|
if (['youtube.com', 'm.youtube.com', 'music.youtube.com'].includes(url.hostname) && url.searchParams.has('v')) {
|
||||||
return { url: urlAsString, id: url.searchParams.get('v') }
|
return { url: urlAsString, id: url.searchParams.get('v') }
|
||||||
} else if (url.hostname === 'youtu.be') {
|
} else if (url.hostname === 'youtu.be') {
|
||||||
return { url: urlAsString, id: url.pathname.substring(1) }
|
return { url: urlAsString, id: url.pathname.substring(1) }
|
||||||
|
Reference in New Issue
Block a user