diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-01-31 20:06:15 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2020-01-31 20:06:15 -0800 |
commit | f787e4e2027583476ca34bd01c8462f6459369bb (patch) | |
tree | 3ac533d55d3f524a49abbd83957b9c87d65f357a /youtube/channel.py | |
parent | cd4a2fb0ebb63600d9e66fa695c6517a968a78f8 (diff) | |
download | yt-local-f787e4e2027583476ca34bd01c8462f6459369bb.tar.lz yt-local-f787e4e2027583476ca34bd01c8462f6459369bb.tar.xz yt-local-f787e4e2027583476ca34bd01c8462f6459369bb.zip |
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.
Diffstat (limited to 'youtube/channel.py')
-rw-r--r-- | youtube/channel.py | 2 |
1 files changed, 2 insertions, 0 deletions
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') |