-
Notifications
You must be signed in to change notification settings - Fork 272
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
Program stops downloading VOD at 90-99% (the last time at 36%) #772
Comments
If you are able to reproduce again with the current version, please see if 1.53.1 solves the problem. |
I forgot to write that I can download 480p VOD, but 1080p has problem. So i guess it's because of the file size, 4GiB is fine, but 16GiB is a problem. I successfully downloaded full second VOD on the new version 1.53.2, but the first VOD had the same problem. The last attempt stops at 91% (Download Threads is 1, disk with cache folder has 150 GB of free space), one last 2029.ts part has 0 KB size. |
I tried downloading VOD to the cache folder and finally downloaded second VOD. |
Thank you for leaving it idle! I added some verification logic in #756 in case downloads were interrupted. It's annoying that it supposedly took hours though, in theory it should have taken at most 8¼ minutes to timeout all 9 parts (assuming 1 thread). I will reduce the timeout period since we now have redownloading partially implemented. |
I have found the true source of the 99% stop. When the request to Twitch is closed before the video file is completely written, the content stream is no longer receiving data but still remains open. In theory this would let the cancel button still work and in practice it does. |
I am able to reproduce this problem pretty often. How can I help to debug and solve this issue? It's just basic idea, after playing with the code for couple hours |
Is your internet very unstable? I know others experience it too, but I was only able to reproduce it myself by disconnecting from the internet for 120 seconds.
The cache files are not actually 0KB, file explorer just has not indexed the file yet because it is still opened by TwitchDownloader. If you open the file properties window you will see it reports the true size on disk. Additionally, "just check after x seconds" means spawning a background thread for each download thread which is a huge waste of resources. If we had just one download thread then I wouldn't really mind, but when users have 20+ threads per download it's a problem.
I am aware and wrote an extension method to resolve this for the clip downloader.
The HttpClient will throw a timeout exception when the request is not answered within the timeout period. Once we begin downloading the file to the disk, the HttpClient is not responsible for the response message.
That stackoverflow implementation is disgusting and wastes resources. I have a few better ideas that should work while consuming less resources. |
I have an implementation that verifiably solves the problem, but it may impact users with very slow internet (<1.3Mbps (160KB/s) for 1080p60 downloads). I have a WIP alternative implementation that monitors the download speed of each thread, but it's causing some extremely weird behavior and I don't understand why. I will probably just double the timeout such that it will only affect users with extremely slow internet (<600Kbps (75KB/s) for 1080p60 downloads). According to worldpopulationreview.com, this may affect a handful countries if users are 800%+ behind the average broadband speed. |
Checklist
Edition
Windows GUI Application
Describe your issue here
The last ~10 VOD parts (.ts) have 0 KB size in the cache folder.
Previously, the program rarely had problems with a 99% download, but the second download attempt was always successful. Now I can't download VOD at all.
Add any related files or extra information here
I have problem with these VODs:
https://www.twitch.tv/videos/1886532192
https://www.twitch.tv/videos/1887391942
The text was updated successfully, but these errors were encountered: