From c56fc56fa66242ae75a5b8f3e9c697f0f23c253a Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 22 Dec 2019 19:00:44 -0800 Subject: Subscriptions: Cleaner error message when checking terminated channels Don't display a nasty traceback in that case. --- youtube/subscriptions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'youtube') diff --git a/youtube/subscriptions.py b/youtube/subscriptions.py index 2c8f5f5..76130f3 100644 --- a/youtube/subscriptions.py +++ b/youtube/subscriptions.py @@ -453,9 +453,11 @@ def _get_upstream_videos(channel_id): time_published = int(calendar.timegm(time.strptime(time_published_element.text, '%Y-%m-%dT%H:%M:%S+00:00'))) times_published[video_id_element.text] = time_published - except (AssertionError, defusedxml.ElementTree.ParseError) as e: + except AssertionError: print('Failed to read atoma feed for ' + channel_status_name) traceback.print_exc() + except defusedxml.ElementTree.ParseError: + print('Failed to read atoma feed for ' + channel_status_name) channel_info = yt_data_extract.extract_channel_info(json.loads(channel_tab), 'videos') if channel_info['error']: -- cgit v1.2.3