mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-26 05:30:17 +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)
|
response = requests.delete(url, auth=es_auth)
|
||||||
if not response.ok and not response.status_code == 404:
|
if not response.ok and not response.status_code == 404:
|
||||||
print(response.text)
|
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 = VideoDownloader()
|
||||||
downloader.add_pending()
|
downloader.add_pending()
|
||||||
downloader.run_queue()
|
downloader.run_queue()
|
||||||
|
downloader.validate_playlists()
|
||||||
else:
|
else:
|
||||||
print("Did not acquire download lock.")
|
print("Did not acquire download lock.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user