Marak/buddypond

Youtube smartlinks should work for all youtube url formats

Marak opened this issue · 9 comments

Marak commented

Right now we only support one YT link style like:

https://www.youtube.com/watch?v=v1K4EAXe2oo

We also need to support links like this:

https://youtu.be/v1K4EAXe2oo?t=26

( Notice it's a shortened URL and also it has time embed _

I am working on it. Hopefully will have smtg this week.

Ok I need help:
This line:

cleanText = cleanText.replace(str, `<a class="openIDC" href="#open_IDC" data-videoid="${id}">youtube: ${id}</a>`)

This is what triggers the Interdimensional Cable window to open right? When I send just an ID to it, for instance "v1K4EAXe2oo" it works. But if I send an ID with its time, for instance "v1K4EAXe2oo?t=26" then the video cannot be found.

Screenshot 2022-03-22 at 20 21 45

I feel like something somewhere else in some other part of the code needs to be changed . But I don't know where to look for. Any input on that?

Marak commented

This looks like it may be known CORS issue with youtube and some youtube videos don't work on localhost.

Try a few other videos or try using domain entry in local /etc/hosts file.

Just made the PR

Marak commented

Thanks @mardub1635 !!!

Merged.

We still don't seem to support this format thou: https://www.youtube.com/watch?v=8JgxMVMBESY&t=33s

I did not know this format existed. Thanks.
One question though, in which context do you get such link? The only time I get started links on youtube is because I click on the "shared" button and it always give me the short youtu.be version.

Marak commented

Not sure of the context.

The format is valid and should be supported.

Will keep this issue open for now. Thanks again for your contributions.

No need to, I did the PR it is solved.