From 9e0515609f16a6347a049e73a10555c8b9d72419 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 16 Feb 2024 18:41:05 +0000 Subject: [PATCH] HLS: Ignore possible folders when doing naive final merge --- devine/core/manifests/hls.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devine/core/manifests/hls.py b/devine/core/manifests/hls.py index e99f982..dd1fd66 100644 --- a/devine/core/manifests/hls.py +++ b/devine/core/manifests/hls.py @@ -481,10 +481,11 @@ class HLS: else: with open(save_path, "wb") as f: for discontinuity_file in sorted(save_dir.iterdir()): + if discontinuity_file.is_dir(): + continue discontinuity_data = discontinuity_file.read_bytes() f.write(discontinuity_data) - discontinuity_file.unlink() - save_dir.rmdir() + shutil.rmtree(save_dir) progress(downloaded="Downloaded")