Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.08k stars 87 forks source link

--save-state - how to restart existing stream? #200

Open jonathanbgardner opened 1 month ago

jonathanbgardner commented 1 month ago

The README file includes reference to a --save-state flag you can include in a command line prompt that saves a portion of an already-started live stream download, but there is no reference made as to how to restart a download of a live stream after manually stopping it.

Is there a mechanism for doing so? I'm not very familiar with Go, but I couldn't find anything specifically supporting this in player_response.go.

If so, can you add it to the README file? If not, can we get support for this?

Use Case: A video editor is downloading a video from a live stream to cut into short-form clips for YT Shorts, TikTok, etc. They need to start cutting up the part they have downloaded to create YT Shorts or other short-form video from the longer video, but the live stream is still going. They need to manually cancel the stream download to mux the file, but they want to continue downloading the stream from where they started after muxing the existing files to avoid redundancy and overlap between two download files.

Kethsar commented 1 month ago

That is currently not supported. It was meant to work that way, but I forgot to test manually stopping a stream when it was caught up after implementing it. The current logic just automatically starts the muxing if your download is caught up. I do want to fix this at some point. You might be able to force it by killing the process, running the ffmpeg command manually, and re-running the yta command. On Windows you could use the task manager to kill the process, I think.

Kethsar commented 1 month ago

Well after testing it seems manually stopping the stream does not actually automatically start muxing if it's caught up, and does go through the set of questions if you don't have flags set specifically to bypass them. As long as the stream has not ended, that is. That means if you stop the stream and then answer "no" to the first two questions but "yes" to saving state, you should be able to follow the above steps without needing to hard kill the process.