Skip to content

A feature-rich command-line audio/video downloader

[downloader/hls] Properly close stream

Sergey M․133a2b4ac21e
diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py
index 71aafdc73e..b2436e732c 100644
--- a/youtube_dl/downloader/hls.py
+++ b/youtube_dl/downloader/hls.py
@@ -92,6 +92,7 @@ class NativeHlsFD(FragmentFD):
return False
down, frag_sanitized = sanitize_open(frag_filename, 'rb')
ctx['dest_stream'].write(down.read())
+ down.close()
frags_filenames.append(frag_sanitized)
self._finish_frag_download(ctx)