Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow removing fragments for incomplete HLS downloads (was: hls fragment downloader does not clean up after itself) #9512
Comments
|
These files are kept in failure for restarting the download. I guess it's OK to always delete these files if |
|
This is not actual now since fragments are not stored on disk anymore. |
What is the purpose of your issue?
Not sure if it counts as a bug or a feature request, to me it is a small annoyance tho.
youtube-dl may download tons of fragments via the hls dowloader to individual files.
https://github.com/rg3/youtube-dl/blob/master/youtube_dl/downloader/hls.py#L74-L88
If there is an unrecoverable error, e.g. when a stream is removed, then these files will never get removed; they are only ever removed once all fragments have been retrieved successfully, which will never happen once the stream is gone, no matter how hard one tries to resume.
To fix this properly, there needs to be a distinction between unrecoverable errors (e.g. stream is gone) and recoverable errors (e.g. user aborted, but may resume later).
And maybe even an option to remove fragment files always.
Since I personally use youtube-dl in an automated fashion, my local fix does not have to deal potentially resuming later, so I just moved the
os.remove-loop into afinally.