error handling for playlist sub

This commit is contained in:
Simon 2023-10-03 19:57:12 +07:00
parent 8af7a3caf4
commit e9eddf06fb
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 5 additions and 0 deletions

View File

@ -187,6 +187,11 @@ class PlaylistSubscription:
playlist_h = YoutubePlaylist(playlist_id)
playlist_h.all_youtube_ids = all_youtube_ids
playlist_h.build_json()
if not playlist_h.json_data:
message = f"{playlist_h.youtube_id}: failed to extract data"
print(message)
raise ValueError(message)
playlist_h.json_data["playlist_subscribed"] = subscribed
playlist_h.upload_to_es()
playlist_h.add_vids_to_playlist()