diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index d7f943b..6580e14 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -483,6 +483,10 @@ class DASH: status_update["downloaded"] = f"DASH {downloaded}" progress(**status_update) + # see https://github.com/devine-dl/devine/issues/71 + for control_file in save_dir.glob("*.aria2__temp"): + control_file.unlink() + segments_to_merge = sorted(save_dir.iterdir()) progress(downloaded="Merging", completed=0, total=len(segments_to_merge)) diff --git a/devine/core/manifests/hls.py b/devine/core/manifests/hls.py index 258e8aa..7f47e39 100644 --- a/devine/core/manifests/hls.py +++ b/devine/core/manifests/hls.py @@ -291,6 +291,10 @@ class HLS: status_update["downloaded"] = f"HLS {downloaded}" progress(**status_update) + # see https://github.com/devine-dl/devine/issues/71 + for control_file in segment_save_dir.glob("*.aria2__temp"): + control_file.unlink() + progress(total=total_segments, completed=0, downloaded="Merging") name_len = len(str(total_segments)) diff --git a/devine/core/tracks/track.py b/devine/core/tracks/track.py index 0c75c22..219cce6 100644 --- a/devine/core/tracks/track.py +++ b/devine/core/tracks/track.py @@ -225,6 +225,9 @@ class Track: if not file_downloaded: progress(**status_update) + # see https://github.com/devine-dl/devine/issues/71 + save_path.with_suffix(f"{save_path.suffix}.aria2__temp").unlink(missing_ok=True) + self.path = save_path if callable(self.OnDownloaded): self.OnDownloaded()