Zod- / jsVideoUrlParser

A javascript parser to extract informations like provider, channel, id, start time from YouTube, Vimeo, Dailymotion, Twitch,... urls
MIT License
235 stars 73 forks source link

Youtube URL format missing. #20

Closed rodrigograca31 closed 8 years ago

rodrigograca31 commented 8 years ago

Hi! Awesome library!

I've noted that the youtube Android app gives a slight diferente URL that is not supported by this library: http://www.youtube.com/shared?ci=E14kBrDEvYo

For example urlParser.parse("http://www.youtube.com/shared?ci=E14kBrDEvYo"); returns undefined

Steps to reproduce:

  1. Open the Youtube App on your phone. (I've tested on Androdi 4.4 with latest youtube app installed)
  2. Click the "share arrow"
  3. Make sure "Share as [YOUR NAME]" is checked (It was checked by default)
  4. Choose another app. (I've chosen "Clipboard" and pasted somewhere else to see the link)

Thanks!

rodrigograca31 commented 8 years ago

Steps to reproduce:

  1. Open the Youtube App on your phone. (I've tested on Androdi 4.4 with latest youtube app installed)
  2. Click the "share arrow"
  3. Make sure "Share as [YOUR NAME]" is checked (It was checked by default)
  4. Choose another app. (I've chosen "Clipboard" and pasted somewhere else to see the link)
Zod- commented 8 years ago

I don't get those for some reason but there are more links out there like that so I'll just add it.

Zod- commented 8 years ago

Actually it seems like this is a new mediaType since the actual id of the video is A3PDXmYoF5U. The shared url produces a new id that isn't a video in itself. Using the id from your share comes up with no existing video https://youtu.be/E14kBrDEvYo. I'm gonna make a bigger update later on and will add the new mediaType there.

rodrigograca31 commented 8 years ago

@Zod- any way to get the real id? I think you have to open one of these links on your phone before to start seeing an option to create them when you click the Share option on the Android Youtube App.....

Zod- commented 8 years ago

There's probably some YouTube API out there to figure out the real url but this parser isn't the right place to put it in.

rodrigograca31 commented 8 years ago

Are you saying this parser will not support this kind of URL's?

Zod- commented 8 years ago

I just browsed the YouTube API for a while and actually couldn't find anything that would allow you to resolve the real url. Like the list API for videos just returns nothing when you use 'E14kBrDEvYo' as id.

But yeah I didn't want to add it anyway since this is really just about parsing some text and I really don't want some random YouTube API calls to it. Maybe there is a way to get the API to return the real url so what you could do is parse urls with this parser to know it's one of those shared urls and then do API calls with the results.

rodrigograca31 commented 8 years ago

Ok.... I agree. Just as a side note: I've found a commit in youtube-dl that deals with this type of URLs: https://github.com/rg3/youtube-dl/commit/4080530624eda994d535e1a01c38ddd6d9aa3805 They download the page and get the meta tag videoId.