forked from DRMTalks/devine
fix(HLS): Remove save dir even if final merge wasn't needed
This commit is contained in:
parent
35501bdb9c
commit
73d9bc4f94
|
@ -507,6 +507,8 @@ class HLS:
|
||||||
if DOWNLOAD_LICENCE_ONLY.is_set():
|
if DOWNLOAD_LICENCE_ONLY.is_set():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
segment_save_dir.rmdir()
|
||||||
|
|
||||||
# finally merge all the discontinuity save files together to the final path
|
# finally merge all the discontinuity save files together to the final path
|
||||||
segments_to_merge = [
|
segments_to_merge = [
|
||||||
x
|
x
|
||||||
|
@ -522,14 +524,14 @@ class HLS:
|
||||||
segments=segments_to_merge,
|
segments=segments_to_merge,
|
||||||
save_path=save_path
|
save_path=save_path
|
||||||
)
|
)
|
||||||
shutil.rmtree(save_dir)
|
|
||||||
else:
|
else:
|
||||||
with open(save_path, "wb") as f:
|
with open(save_path, "wb") as f:
|
||||||
for discontinuity_file in segments_to_merge:
|
for discontinuity_file in segments_to_merge:
|
||||||
discontinuity_data = discontinuity_file.read_bytes()
|
discontinuity_data = discontinuity_file.read_bytes()
|
||||||
f.write(discontinuity_data)
|
f.write(discontinuity_data)
|
||||||
f.flush()
|
f.flush()
|
||||||
shutil.rmtree(save_dir)
|
|
||||||
|
save_dir.rmdir()
|
||||||
|
|
||||||
progress(downloaded="Downloaded")
|
progress(downloaded="Downloaded")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue