Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.13k stars 91 forks source link

Inconsistent behavior with --monitor-channel function. #145

Closed TheSavvieDrew closed 1 year ago

TheSavvieDrew commented 1 year ago

I am using the following syntax to monitor a channel:

ytarchive.exe --monitor-channel https://www.youtube.com/@{ChannelHandle} best

This function is inconsistently working when detecting that a channel is currently live streaming or is about to live stream and then start downloading once they start streaming. The bahavior seems random to me when I try on a bunch of different channels that are all live or about to go live. I only noticed this behavior today and I have never seen it do this and I have been using this program for a while now.

I know just saying that something is inconsistenly working doesn't help much to solve the problem. The best I can do is offer some of the channels that were not working for me and for you to try and call the function when they are live, or if there is some way to produce a log I can do that too.

Kethsar commented 1 year ago

I noticed this too, just an hour or so ago. When copying some files I realized a stream wasn't downloaded for a channel I have set to monitor. I'll do some testing as I can. Could be Youtube having intermittent issues, could be a new permanent change that broke things and won't be fixed any time soon.

Kethsar commented 1 year ago

Heck just a quick check now shows it's Youtube being dumb. It's not always redirecting to a currently live stream when using /live, and there's no immediately obvious reason why. Either it's going to be a deprecated end point or they are having issues with their systems somewhere. Only time will tell. I've been thinking about implementing scraping the /streams page to look for currently live frames. If this continues to be an issue, I might have to take that route.

Kethsar commented 1 year ago

Okay one last quick update, it's an issue with multiple live frames being available; either currently live or scheduled. Channels with a single stream set up work fine, anything that has more than one scheduled streams or an ongoing livestream as well as one or more scheduled streams just redirect to /streams. This may be intentional, hard to say.

Hakkin commented 1 year ago

Also just noticed this, I was going to suggest using the https://www.youtube.com/embed/live_stream?channel= embed link as a fallback, but checking that, it's also broken now for channels that have multiple streams up. Seems YouTube broke something in the backend for handling multiple streams on the same channel.

Kethsar commented 1 year ago

Yeah, I'll try to get a quick fix out today after work. I have an idea on what to do, I just have to hope the base HTML Youtube gives from /streams is sufficient.

Kethsar commented 1 year ago

Hopefully this is fixed in the latest pre-release. It's working for me but it will probably be some days before we see if I implemented something incorrectly.

glubsy commented 1 year ago

For the record, https://github.com/Kethsar/ytarchive/commit/d4f7a822686ce9d8ea239e9c6b0d2c6ae84bffa0 is the commit related to this fix.