From f787e4e2027583476ca34bd01c8462f6459369bb Mon Sep 17 00:00:00 2001 From: James Taylor Date: Fri, 31 Jan 2020 20:06:15 -0800 Subject: Give a proper error message for 429 errors These occur when too many requests are coming from a Tor exit node. Before, there would be an error page with an exception instructing users to report the issue. But this is an expected and persistent issue. --- youtube/channel.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'youtube/channel.py') diff --git a/youtube/channel.py b/youtube/channel.py index 4df82e5..c897a87 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -179,6 +179,7 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None): gevent.spawn(get_channel_tab, channel_id, page_number, sort, 'videos', view) ) gevent.joinall(tasks) + util.check_gevent_exceptions(*tasks) number_of_videos, polymer_json = tasks[0].value, tasks[1].value elif tab == 'videos': tasks = ( @@ -186,6 +187,7 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None): gevent.spawn(util.fetch_url, base_url + '/videos?pbj=1&view=0', util.desktop_ua + headers_1, debug_name='gen_channel_videos') ) gevent.joinall(tasks) + util.check_gevent_exceptions(*tasks) number_of_videos, polymer_json = tasks[0].value, tasks[1].value elif tab == 'about': polymer_json = util.fetch_url(base_url + '/about?pbj=1', util.desktop_ua + headers_1, debug_name='gen_channel_about') -- cgit v1.2.3