channel.py: Catch FetchError

Should catch this error to fail gracefully

See #227
This commit is contained in:
Astound 2025-02-28 10:51:29 +08:00
parent d361996fc0
commit a0c51731af
Signed by: kaiser
GPG Key ID: 97504AF0027B1A56

View File

@ -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