From 35f1084cc283816a790c8b7d82cce5396f2cc977 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 10 Aug 2022 21:47:26 +0700 Subject: [PATCH] download thumbnail for manual import --- tubearchivist/home/src/index/filesystem.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/index/filesystem.py b/tubearchivist/home/src/index/filesystem.py index 5e80ebc..85e1c95 100644 --- a/tubearchivist/home/src/index/filesystem.py +++ b/tubearchivist/home/src/index/filesystem.py @@ -12,6 +12,7 @@ import shutil import subprocess from home.src.download.queue import PendingList +from home.src.download.thumbnails import ThumbManager from home.src.es.connect import ElasticWrap from home.src.index.reindex import Reindex from home.src.index.video import YoutubeVideo, index_new_video @@ -466,7 +467,8 @@ class ManualImport: def index_metadata(self): """get metadata from yt or json""" - video = YoutubeVideo(self.current_video["video_id"]) + video_id = self.current_video["video_id"] + video = YoutubeVideo(video_id) video.build_json( youtube_meta_overwrite=self._get_info_json(), media_path=self.current_video["media"], @@ -474,6 +476,9 @@ class ManualImport: video.check_subtitles() video.upload_to_es() + url = video.json_data["vid_thumb_url"] + ThumbManager(video_id).download_video_thumb(url) + return video.json_data def _get_info_json(self):