aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-12-21 02:13:52 -0800
committerJames Taylor <user234683@users.noreply.github.com>2018-12-21 02:13:52 -0800
commit6217e6f558cb19fb756d6549e218008e76d4d29f (patch)
treed5e6e45466a327cd8e29368776cfb42bbe399ca5 /youtube
parentf74447bc5c5af1ef39cd9e554c1c208bd064d28c (diff)
downloadyt-local-6217e6f558cb19fb756d6549e218008e76d4d29f.tar.lz
yt-local-6217e6f558cb19fb756d6549e218008e76d4d29f.tar.xz
yt-local-6217e6f558cb19fb756d6549e218008e76d4d29f.zip
Properly handle case of non-existent channel tab
Diffstat (limited to 'youtube')
-rw-r--r--youtube/channel.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube/channel.py b/youtube/channel.py
index ae2a5e3..25e4019 100644
--- a/youtube/channel.py
+++ b/youtube/channel.py
@@ -402,7 +402,7 @@ def get_channel_page(url, query_string=''):
return channel_search_page(polymer_json, query, page_number, number_of_videos, query_string)
else:
- raise ValueError('Unknown channel tab: ' + tab)
+ raise http_errors.Error404('Unknown channel tab: ' + tab)
# youtube.com/user/[username]/[page]
# youtube.com/c/[custom]/[page]
@@ -418,7 +418,7 @@ def get_channel_page_general_url(url, query_string=''):
page = 'videos'
base_url = 'https://www.youtube.com/' + '/'.join(path_components)
else:
- raise ValueError()
+ raise http_errors.Error404('Invalid channel url')
if page == 'videos':
polymer_json = common.fetch_url(base_url + '/videos?pbj=1&view=0', common.desktop_ua + headers_1)
@@ -440,4 +440,4 @@ def get_channel_page_general_url(url, query_string=''):
polymer_json = json.loads(polymer_json)
return channel_search_page('''
else:
- raise ValueError('Unknown channel page: ' + page) \ No newline at end of file
+ raise http_errors.Error404('Unknown channel page: ' + page) \ No newline at end of file