3

I am making an app that can stream a live YouTube video to my app. I want to use ExoPlayer. I went through the demo app of ExoPlayer, and the URL they use in DASH streaming is something like this :

"uri":"http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0"

This is working.

I don't know how to get such a URL and I end up here. Does that mean that I can't stream from YouTube even if the video is my own? (especially Live videos) If I can how can I get such a URL for my video?

karel
  • 5,489
  • 46
  • 45
  • 50
hushed_voice
  • 3,161
  • 3
  • 34
  • 66

1 Answers1

1

I have learned that DASH URLs are actually something that are internal to Google and you might need to use decoder to be able to get your URL.

For this, you may want to try the following solution given by Karim Abdell Salam in this SO post:

  1. First you need to call this url: http://www.youtube.com/get_video_info?&video_id=v1uyQZNg2vE and don't forget to change the last id with the target one.
  2. Now you will get notice to download a file called get_video_info with no extesion.
  3. Try to open this file using notepad and so.
  4. Now you have the right data but you can't read it because its encoded You need HTML decoder to read this data. Use this one: http://meyerweb.com/eric/tools/dencoder/. Just paste your data and press decode a several times to ensure it decoded well
  5. Finally, search for a key called dashmpd and enjoy your URL

You may want to also check these links for more helpful information and updates:

Lastly, you may opt to also try playing live videos on android version 4.2.2 without necessarily using an ExoPlayer as mentioned in this SO post.

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22
  • I have tried that but all i get in the get_video_info is "status=fail&errorcode=2&reason=Invalid+parameters." or "reason=This+video+is+private.&status=fail&errorcode=150&errordetail=0" – hushed_voice Nov 25 '16 at 07:01