mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2025-01-14 12:50:13 +00:00
use user provided thumb for offline import
This commit is contained in:
parent
7029441f89
commit
994f7c2443
@ -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
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user