From 1a73854e1e7591947471f265f4866ce8296f3392 Mon Sep 17 00:00:00 2001 From: jbannon Date: Mon, 18 Jul 2022 05:19:07 +0000 Subject: [PATCH] still copy split video thumbnails --- src/ytdl_sub/downloaders/youtube/split_video.py | 2 +- src/ytdl_sub/utils/file_handler.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ytdl_sub/downloaders/youtube/split_video.py b/src/ytdl_sub/downloaders/youtube/split_video.py index 795aa9c0..5a2e545d 100644 --- a/src/ytdl_sub/downloaders/youtube/split_video.py +++ b/src/ytdl_sub/downloaders/youtube/split_video.py @@ -183,7 +183,7 @@ class YoutubeSplitVideoDownloader( # Copy the original vid thumbnail to the working directory with the new uid. This so # downstream logic thinks this split video has its own thumbnail - FileHandler.move( + FileHandler.copy( src_file_path=entry.get_download_thumbnail_path(), dst_file_path=Path(self.working_directory) / f"{new_uid}.{entry.thumbnail_ext}", ) diff --git a/src/ytdl_sub/utils/file_handler.py b/src/ytdl_sub/utils/file_handler.py index 9bc0b1df..3d9f55f1 100644 --- a/src/ytdl_sub/utils/file_handler.py +++ b/src/ytdl_sub/utils/file_handler.py @@ -176,6 +176,18 @@ class FileHandler: """ return self._file_handler_transaction_log + @classmethod + def copy(cls, src_file_path: Union[str, Path], dst_file_path: Union[str, Path]): + """ + Parameters + ---------- + src_file_path + Source file + dst_file_path + Destination file + """ + shutil.copyfile(src=src_file_path, dst=dst_file_path) + @classmethod def move(cls, src_file_path: Union[str, Path], dst_file_path: Union[str, Path]): """