0

I see YouTube app updated new function to share videos with the url like this:

https://www.youtube.com/shared?ci=8A940MXKFmQ

My app is using YouTube API/videos/list to get video informations and it required the Video ID field.

How can we get youtube video id from the url above. Thanks

Khang .NT
  • 1,504
  • 6
  • 24
  • 46
  • Check this SO question [6556559](http://stackoverflow.com/questions/6556559/youtube-api-extract-video-id) and [3392993](http://stackoverflow.com/questions/3392993/php-regex-to-get-youtube-video-id) if it can help you. – KENdi Jul 23 '16 at 11:58

1 Answers1

1

This is maybe not a good way to do it, but since there seems to be no API for that, check this:

https://github.com/rg3/youtube-dl/commit/4080530624eda994d535e1a01c38ddd6d9aa3805

What they do is fetching the content and search for the meta tag with the name videoId. Again: Not a good way, maybe this approach stops working in a month or a year or maybe never.

jayearn
  • 116
  • 2
  • 3