diff options
author | Astound <kirito@disroot.org> | 2025-02-28 10:51:29 +0800 |
---|---|---|
committer | Astound <kirito@disroot.org> | 2025-02-28 10:51:29 +0800 |
commit | a0c51731af8cad618a243a6ff3934c83b0d84e6e (patch) | |
tree | 84ce8a3e12cad8aff82d1699b605177351f2079c | |
parent | d361996fc06bdc497c6d40c87f54102ba0d81c26 (diff) | |
download | yt-local-a0c51731af8cad618a243a6ff3934c83b0d84e6e.tar.lz yt-local-a0c51731af8cad618a243a6ff3934c83b0d84e6e.tar.xz yt-local-a0c51731af8cad618a243a6ff3934c83b0d84e6e.zip |
channel.py: Catch FetchError
Should catch this error to fail gracefully
See #227
-rw-r--r-- | youtube/channel.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |