youtube-dl: [Youtube] youtube-dl fails to retrieve the hls manifest for livestreams
The way to retrieve the hls manifest for youtube livestreams changed. See @yan12125 s comment below for fix.
Original:
Please follow the guide below
- You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
- Put an
x
into all the boxes [ ] relevant to your issue (like this:[x]
)- Use the Preview tab to see what your issue will actually look like
Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2018.01.07. If it’s not, read this FAQ entry and update. Issues with outdated version will be rejected.
- [ x ] I’ve verified and I assure that I’m running youtube-dl 2018.01.07
Before submitting an issue make sure you have:
- [ x ] At least skimmed through the README, most notably the FAQ and BUGS sections
- [ x ] Searched the bugtracker for similar issues including closed ones
What is the purpose of your issue?
- [ x ] Bug report (encountered problems with youtube-dl)
- Site support request (request for adding support for a new site)
- Feature request (request for a new functionality)
- Question
- Other
Youtube seemed to change how they deliver the hls files for livestreams, if the livestreams allows you to jump back several hours. Instead of providing an hls stream url, youtube-dl (2018.01.07) only provides the latest segment of the stream.
For example: This livestream works flawless like before: NASA Livestream https://www.youtube.com/watch?v=RtU_mdL2vBM
this one (with the ability to go back) doesn’t: Live Train 24 https://www.youtube.com/watch?v=qghQ5eKGcyE
Streamlink also suffered from this issue, so i think it’s a change on youtubes side: https://github.com/streamlink/streamlink/issues/1421
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 5
- Comments: 21
A quick and dirty patch for HLS:
Apparently Youtube still has HLS for live streams: For Euronews Live:
youtube-dl -j https://www.youtube.com/watch?v=xAE4xX8Izvo Only produces MPD formats
youtube-dl --print-traffic https://www.youtube.com/watch?v=xAE4xX8Izvo Has no HLS entries
BUT curl -sL -k “https://www.youtube.com/watch?v=xAE4xX8Izvo” has a very valid HLS link:
“hlsvp”:"https://manifest.googlevideo.com/api/manifest/hls_variant/gcr.…m3u8
This stream (https://youtu.be/9h6Vz6ylIdE) and the NASA one mentioned above have been active since before this change by YouTube.
If you
youtube-dl -F
any new streams, you’ll see (at least this is what I’m seeing anyway) that they don’t have hls streams anymore.Further - it appears that on the browser, when clicking the nerd stats, there is no longer the line that indicates if it’s a DASH stream or not, seemingly confirming that it’s just all DASH now. It’s not overly surprising given that HLS streams were 30fps irrespective of what went in - every stream had to be converted for archive and this had long been just a compatibility feature.
Perhaps what is needed is to change this to a feature request; simply for youtube-dl to support dynamic MPD manifests (it already fully supports static ones)
I know from manual debugging, and lots of
grep
andjq
(and more recently usingyoutube-dl
with the--youtube-include-dash-manifest
option), that the MPD playlist is available from the earliest segment available on the stream (about 4 hours worth if the stream is 24/7 from memory), so it could be cleanly implemented.As a sidenote - same deal for
streamlink
- this never supported DASH at all for live streams with youtube, but it seems now that a combination of youtubes new defaults and some minor changes mentioned on this thread (and fixed [here])(https://github.com/streamlink/streamlink/pull/1423), that there is some playability.The live dash manifest URL is in the player config JSON.
Or extract it yourself: