diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-09-08 17:48:02 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-09-08 17:48:02 -0700 |
commit | 216231f9a6ca9ed48389e797a0c30d7d3b01e379 (patch) | |
tree | 1fed2d2b6b4cce1db21f7a27809282b4ac95e4a1 /youtube/subscriptions.py | |
parent | bd343ed71f628e0f1dd1eb3f45fb4e04887f223f (diff) | |
download | yt-local-216231f9a6ca9ed48389e797a0c30d7d3b01e379.tar.lz yt-local-216231f9a6ca9ed48389e797a0c30d7d3b01e379.tar.xz yt-local-216231f9a6ca9ed48389e797a0c30d7d3b01e379.zip |
Extraction: Proper error handling for terminated or non-existant channels
Diffstat (limited to 'youtube/subscriptions.py')
-rw-r--r-- | youtube/subscriptions.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube/subscriptions.py b/youtube/subscriptions.py index 175622f..87e1659 100644 --- a/youtube/subscriptions.py +++ b/youtube/subscriptions.py @@ -455,7 +455,12 @@ def _get_upstream_videos(channel_id): print('Failed to read atoma feed for ' + channel_status_name) traceback.print_exc() - videos = yt_data_extract.extract_channel_info(json.loads(channel_tab), 'videos')['items'] + channel_info = yt_data_extract.extract_channel_info(json.loads(channel_tab), 'videos') + if channel_info['errors']: + print('Error checking channel ' + channel_status_name + ': ' + ', '.join(channel_info['errors'])) + return + + videos = channel_info['items'] for i, video_item in enumerate(videos): if 'description' not in video_item: video_item['description'] = '' |