From a0c51731af8cad618a243a6ff3934c83b0d84e6e Mon Sep 17 00:00:00 2001 From: Astound Date: Fri, 28 Feb 2025 10:51:29 +0800 Subject: channel.py: Catch FetchError Should catch this error to fail gracefully See #227 --- youtube/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube/channel.py b/youtube/channel.py index b520121..81881eb 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -292,7 +292,7 @@ def get_number_of_videos_channel(channel_id): try: response = util.fetch_url(url, headers_mobile, debug_name='number_of_videos', report_text='Got number of videos') - except urllib.error.HTTPError as e: + except (urllib.error.HTTPError, util.FetchError) as e: traceback.print_exc() print("Couldn't retrieve number of videos") return 1000 -- cgit v1.2.3