From 73d9bc4f9404ebc420dcb02d9a97487d0b32ba00 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 9 Mar 2024 19:39:39 +0000 Subject: [PATCH] fix(HLS): Remove save dir even if final merge wasn't needed --- devine/core/manifests/hls.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devine/core/manifests/hls.py b/devine/core/manifests/hls.py index aab72c8..7674ea9 100644 --- a/devine/core/manifests/hls.py +++ b/devine/core/manifests/hls.py @@ -507,6 +507,8 @@ class HLS: if DOWNLOAD_LICENCE_ONLY.is_set(): return + segment_save_dir.rmdir() + # finally merge all the discontinuity save files together to the final path segments_to_merge = [ x @@ -522,14 +524,14 @@ class HLS: segments=segments_to_merge, save_path=save_path ) - shutil.rmtree(save_dir) else: with open(save_path, "wb") as f: for discontinuity_file in segments_to_merge: discontinuity_data = discontinuity_file.read_bytes() f.write(discontinuity_data) f.flush() - shutil.rmtree(save_dir) + + save_dir.rmdir() progress(downloaded="Downloaded")