streamlink icon indicating copy to clipboard operation
streamlink copied to clipboard

plugins.youtube: rewind support / DASH streams

Open GiovanH opened this issue 4 years ago • 20 comments

Feature Request

  • [x] This is a feature request and I have read the contribution guidelines.

Description

Youtube and some other sites have replaced HLS rewinding with DASH, and so Streamlink can no longer download live streams from the beginning.

Expected / Actual behavior

Some youtube streams have "rewind" enabled, allowing users to rewind to the beginning of the stream and watch the full stream with history.

Formerly, Streamlink was able to interface this and download the complete stream using --hls-live-restart. Apparently, youtube no longer uses hls for this, and so the ability to interface with dash and recover previous segments is required to ensure continued functionality.

Additional comments, screenshots, etc.

See related issues:

https://github.com/streamlink/streamlink/issues/2572 https://github.com/streamlink/streamlink/issues/2890 https://github.com/streamlink/streamlink/issues/2891 https://github.com/streamlink/streamlink/issues/2935

And especially these comments:

https://github.com/streamlink/streamlink/issues/2891#issuecomment-612662516 https://github.com/streamlink/streamlink/issues/2935#issuecomment-619452446

GiovanH avatar Apr 25 '20 23:04 GiovanH

https://github.com/streamlink/streamlink/issues/2891#issuecomment-612662516 is by far the most important comment for anyone looking at this. We tried to get it working before but it created major problems so we gave up on it. If anyone wants to try again the notes linked in that comment are going to be the best starting place.

Edit: I am going to lock all other Youtube HLS rewind issues. DO NOT comment on this with any "this is broken for me", or "+1" or anything else useless like that which doesn't contribute to providing code that moves towards a solution. If I start seeing that in here as well I'm going to delete those comments as they don't contribute anything helpful and simply clutter the issue.

gravyboat avatar Apr 25 '20 23:04 gravyboat

I think this will require some quite significant work on the way streams are downloaded to make it feasible. I started work on a redesign of that stuff and maybe it’s something we can look at for 2.0.0 - I will write up some design docs next week and create and issue to describe what I’m thinking.

beardypig avatar Apr 26 '20 07:04 beardypig

For people who need this functionality - there is an "alternative", Mediahuman youtube-downloader, which does download youtube livestreams from the start. However for me a number of times it would cancel midway through the stream with "Download completed". Another "alternative" would be setting up a cron job with some shitty bash script to get new livestream from rss and start downloading it as it goes live.

ghost avatar May 25 '20 10:05 ghost

Is there any other "free" alternative to streamlink that has youtube rewind support? Mediahuman youtube-downloader is asking for $20.

rusty148 avatar Jul 26 '20 03:07 rusty148

guys I cannot play youtube live i.e. skynews live. can someone help please?

bachoo786 avatar Aug 09 '20 12:08 bachoo786

@bachoo786 Did you read through the issue? If it's a DASH stream it won't work. Adding this sort of comment creates pointless noise. No one can help you because of the nature of the problem. We can't just "fix it", it's not that simple. If someone feels like working on this they will.

gravyboat avatar Aug 09 '20 18:08 gravyboat

@gravyboat relax mate could have said it in nicer way jheez

bachoo786 avatar Aug 09 '20 18:08 bachoo786

MediaHuman YouTube Downloader doesn't work either, it says "Live streams are not supported".

trueTrueman avatar Aug 11 '20 19:08 trueTrueman

Even if only a small amount of people report that issue on github, much more people do not bother doing it and simply drop streamlink because it just does not work for them any longer. We would appreciate this feature implemented. A feedback is not "pointless notifications".

NyamSpectrum avatar Oct 17 '20 18:10 NyamSpectrum

@Entrack If they drop Streamlink because it doesn't work that's fine and their choice, this isn't a product people are paying for where we have some sort of obligation to make certain functionality work or prioritize any functionality over what people feel like working on.

More feedback is absolutely a pointless notification at this point unless that feedback includes a solution, code, or possible way to make this work. We understand some of the people using this free and open source software would like DASH support. If it was as simple as snapping our fingers and having it done we would have done so already (and we have tried).

This software is free and open source. If you don't like how we run it and want to fork us, feel free to do so. If you want to submit a PR to fix it we'll review that PR. Until that point remember that people are spending their limited free time working on this software without compensation. If you don't like that people pick and choose what they want to work on in their spare time that's not our problem.

gravyboat avatar Oct 17 '20 19:10 gravyboat

This project works for downloading ongoing streams from the start https://github.com/rytsikau/ee.Yrewind, seems to only support Windows though.

bamtan avatar Nov 07 '20 01:11 bamtan

This is the Streamlink issue/bug tracker, not a place for discussing how you can download stuff from youtube via unrelated and/or proprietary software.

bastimeyer avatar Nov 07 '20 01:11 bastimeyer

@bamtan That is a cool work around that according to the readme uses chrome, probably headlessly through an api. The actual chrome integration and implementation is closed source and the executable uses obfuscation, and thus you wouldn't know if it is doing questionable things now or in future releases. So overall I would be cautious in using it.

As far as using a similar technique for streamlink, I also have to wonder if the maintainers here would want to bundle chrome. So far it seems they want to continue on their path of producing their own implementation, which likely offers much more control.

CeruleanSky avatar Nov 07 '20 01:11 CeruleanSky

I suppose it doesn't hurt to note other working alternatives though, as if someone was having trouble with DASH downloads, this is a sensible place for them to look.

GiovanH avatar Nov 07 '20 01:11 GiovanH

This would still be very nice.

jaw-sh avatar Jan 29 '21 12:01 jaw-sh

https://github.com/Kethsar/ytarchive

tanocso avatar Dec 14 '21 07:12 tanocso

The ytarchive utility has been rewritten in golang, but for those who understand python better and want to see it in that language working at the time of this comment despite some bugs, here is a link to the python version as it will be removed: https://github.com/Kethsar/ytarchive/blob/v0.3.0/ytarchive.py

Unlike the previous suggestion put here, this does not rely on a web engine or opening a browser, and is actually open source, MIT no less, so it should be easy to adapt. I am already slapping together something for my private streamlink build.

Thanks for pointing it out!

CeruleanSky avatar Dec 14 '21 08:12 CeruleanSky

As this may help whoever implements this the proper way in streamlink, download a live stream from its start for DASH has been merged into yt-dlp: [youtube] download live from the start, to the end #888

When the next yt-dlp version releases you can use yt-dlp --wait-for-video 120 --live-from-start to watch for and start downloading a livestream.

CeruleanSky avatar Dec 20 '21 22:12 CeruleanSky

Is this work in progress to be implemented in streamlink? :)

mbalos16 avatar Feb 24 '22 23:02 mbalos16

Since currently adaptive formats are not supported for live streams. If someone needs, here is an alternative https://github.com/jmf1988/ytdash It is mostly focused on live playback. Works well and in fact only tool that I found that supports live youtube dash playback currently.

Sorry for linking other project, but I think it may be useful for some and there is not much development on streamlink side to support adaptive playback.

kasper93 avatar Mar 04 '22 14:03 kasper93