From ed2e1e9a8703731496728f1de4c2c260de047e9b Mon Sep 17 00:00:00 2001 From: e00E Date: Wed, 7 Oct 2015 13:50:21 +0200 Subject: [PATCH] Reduced disk space usage of native hls downloader --- youtube_dl/downloader/hls.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py index a62d2047b..3e08d20ed 100644 --- a/youtube_dl/downloader/hls.py +++ b/youtube_dl/downloader/hls.py @@ -99,14 +99,14 @@ class NativeHlsFD(FragmentFD): success = ctx['dl'].download(frag_filename, {'url': frag_url}) if not success: return False - down, frag_sanitized = sanitize_open(frag_filename, 'rb') + frags_filenames.append(frag_sanitized) + + for frag_file in frags_filenames: + down, frag_sanitized = sanitize_open(frag_file, 'rb') ctx['dest_stream'].write(down.read()) down.close() - frags_filenames.append(frag_sanitized) + os.remove(encodeFilename(frag_file)) self._finish_frag_download(ctx) - for frag_file in frags_filenames: - os.remove(encodeFilename(frag_file)) - return True