diff --git a/tubearchivist/home/src/index/filesystem.py b/tubearchivist/home/src/index/filesystem.py index 85e1c953..ac498303 100644 --- a/tubearchivist/home/src/index/filesystem.py +++ b/tubearchivist/home/src/index/filesystem.py @@ -476,8 +476,13 @@ class ManualImport: video.check_subtitles() video.upload_to_es() - url = video.json_data["vid_thumb_url"] - ThumbManager(video_id).download_video_thumb(url) + if video.offline_import and self.current_video["thumb"]: + old_path = self.current_video["thumb"] + new_path = ThumbManager(video_id).vid_thumb_path(absolute=True) + shutil.move(old_path, new_path, copy_function=shutil.copyfile) + else: + url = video.json_data["vid_thumb_url"] + ThumbManager(video_id).download_video_thumb(url) return video.json_data diff --git a/tubearchivist/home/src/index/video.py b/tubearchivist/home/src/index/video.py index 48c3eeb4..a2b54970 100644 --- a/tubearchivist/home/src/index/video.py +++ b/tubearchivist/home/src/index/video.py @@ -425,6 +425,7 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle): self.channel_id = False self.video_overwrites = video_overwrites self.es_path = f"{self.index_name}/_doc/{youtube_id}" + self.offline_import = False def build_json(self, youtube_meta_overwrite=False, media_path=False): """build json dict of video""" @@ -434,6 +435,7 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle): if not self.youtube_meta: self.youtube_meta = youtube_meta_overwrite + self.offline_import = True self._process_youtube_meta() self._add_channel()