mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
validate_playlists after run_queue from VideoDownloader
This commit is contained in:
parent
d0e0903d48
commit
fcddf85245
@ -637,3 +637,18 @@ class VideoDownloader:
|
||||
response = requests.delete(url, auth=es_auth)
|
||||
if not response.ok and not response.status_code == 404:
|
||||
print(response.text)
|
||||
|
||||
def validate_playlists(self):
|
||||
"""update playlists"""
|
||||
print("sync playlists")
|
||||
all_indexed = PendingList().get_all_indexed()
|
||||
all_youtube_ids = [i["youtube_id"] for i in all_indexed]
|
||||
for channel_id in self.channels:
|
||||
playlists = YoutubeChannel(channel_id).get_indexed_playlists()
|
||||
all_playlist_ids = [i["playlist_id"] for i in playlists]
|
||||
for playlist_id in all_playlist_ids:
|
||||
playlist_handler = YoutubePlaylist(
|
||||
playlist_id, all_youtube_ids=all_youtube_ids
|
||||
)
|
||||
_ = playlist_handler.update_playlist()
|
||||
playlist_handler.add_vids_to_playlist()
|
||||
|
@ -71,6 +71,7 @@ def download_pending():
|
||||
downloader = VideoDownloader()
|
||||
downloader.add_pending()
|
||||
downloader.run_queue()
|
||||
downloader.validate_playlists()
|
||||
else:
|
||||
print("Did not acquire download lock.")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user