From 44e1720aab81c5a3b182ad8356d052b41e234394 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 11 Nov 2021 21:17:04 +0700 Subject: [PATCH] add thumbnail extraction to channel playlist scraper --- tubearchivist/home/tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/tasks.py b/tubearchivist/home/tasks.py index c69bf18..51a5e6b 100644 --- a/tubearchivist/home/tasks.py +++ b/tubearchivist/home/tasks.py @@ -201,7 +201,7 @@ def subscribe_to(url_str): ) -@shared_task() +@shared_task def index_channel_playlists(channel_id): """add all playlists of channel to index""" channel_handler = YoutubeChannel(channel_id) @@ -210,4 +210,10 @@ def index_channel_playlists(channel_id): for playlist_id, playlist_title in all_playlists: print("add playlist: " + playlist_title) playlist_handler = YoutubePlaylist(playlist_id) + playlist_handler.get_playlist_dict() playlist_handler.upload_to_es() + + if all_playlists: + handler = ThumbManager() + missing_playlists = handler.get_missing_playlists() + handler.download_playlist(missing_playlists)