Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should be able to recover from tcp errors #190

Open
thatstarcreator opened this issue May 10, 2024 · 3 comments
Open

Should be able to recover from tcp errors #190

thatstarcreator opened this issue May 10, 2024 · 3 comments

Comments

@thatstarcreator
Copy link

thatstarcreator commented May 10, 2024

Very frequently ytarchive hits a network error of some sort. Network interruption is typically only a matter of seconds, but it causes ytarchive to immediately stop the download in progress and begin final muxing when the stream in progress hasn't actually ended. ytarchive should instead attempt to retry and resume the download. This can also occur following the timer for waiting for stream to start, in which case the download never starts despite the stream being live.

Running v0.4.0 (Aug 20, 2023) on Windows 11 23H2.

See the following output:

2024/05/09 20:00:03 Selected quality: 1080p60 (h264)
2024/05/09 22:00:15 WARNING: Failed to retrieve data from https://www.youtube.com/watch?v=xxxxx: Get "https://www.youtube.com/watch?v=xxxxx": dial tcp: lookup www.youtube.com: i/o timeout

2024/05/09 22:00:15 ERROR: Error retrieving player response: unable to retrieve data from video page
Video Fragments: 7535; Audio Fragments: 7536; Total Downloaded: 4.10GiB
2024/05/09 22:00:15 Download Finished
2024/05/09 22:00:15 Muxing final file...
@thatstarcreator
Copy link
Author

thatstarcreator commented Jun 17, 2024

I suspect what is occurring is there is a DNS timeout when util.go DownloadData calls client.get during the hourly update interval, and the resulting error bubbles up in a way that everything stops. Perhaps a retry loop could be added around this call just in case the abnormal network condition fixes itself within three or four tries (which in my case it does).

@SigmaTheFox
Copy link

Any solution for this yet?
I had my internet die for a couple minutes while downloading a live stream, and ytarchive didn't continue downloading once I got the connection back.
It didn't start the muxing, and instead showed that it was downloading fragments, but it never actually did. I had to close and resume manually.

I tried a few things, but testing appears to be a bit difficult, as disconnecting the device from internet doesn't cause this error, and instead resumes without issues.

@thatstarcreator
Copy link
Author

I just observed this for the first time, but oddly it was only the video portion that stopped downloading, while audio was unaffected. That said, I think that's a separate issue from this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants