From 9fce56cc660c8ef97408edeaaee2c15108f3444a Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 12 Mar 2024 11:07:40 +0000 Subject: [PATCH 1/2] fix(Video): Delete original file after using change_color_range() --- devine/core/tracks/video.py | 1 + 1 file changed, 1 insertion(+) diff --git a/devine/core/tracks/video.py b/devine/core/tracks/video.py index b3728c8..1d07e5b 100644 --- a/devine/core/tracks/video.py +++ b/devine/core/tracks/video.py @@ -201,6 +201,7 @@ class Video(Track): ], check=True) self.path = output_path + original_path.unlink() def ccextractor( self, track_id: Any, out_path: Union[Path, str], language: Language, original: bool = False From 458ad70fae27fb28c070e3b7317542755c2f32b0 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 12 Mar 2024 11:08:15 +0000 Subject: [PATCH 2/2] fix(Video): Delete original file after using remove_eia_cc() --- devine/core/tracks/video.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devine/core/tracks/video.py b/devine/core/tracks/video.py index 1d07e5b..80c29b9 100644 --- a/devine/core/tracks/video.py +++ b/devine/core/tracks/video.py @@ -321,11 +321,12 @@ class Video(Track): i = file.index(b"x264") encoding_settings = file[i: i + file[i:].index(b"\x00")].replace(b":", br"\\:").replace(b",", br"\,").decode() - cleaned_path = self.path.with_suffix(f".cleaned{self.path.suffix}") + original_path = self.path + cleaned_path = original_path.with_suffix(f".cleaned{original_path.suffix}") subprocess.run([ executable, "-hide_banner", "-loglevel", "panic", - "-i", self.path, + "-i", original_path, "-map_metadata", "-1", "-fflags", "bitexact", "-bsf:v", f"filter_units=remove_types=6,h264_metadata=sei_user_data={uuid}+{encoding_settings}", @@ -336,6 +337,7 @@ class Video(Track): log.info(" + Removed") self.path = cleaned_path + original_path.unlink() return True