diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-09-18 21:39:53 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-09-19 11:06:34 -0700 |
commit | dc6c370152d063ad4198c747fc12eb06fc1ec0e4 (patch) | |
tree | af8fe44dd7440fde043040f2f2485aa31e22a6d9 /youtube/channel.py | |
parent | 89e5761f8d9ae4221c4a97eca3c0fce3405a5bc4 (diff) | |
download | yt-local-dc6c370152d063ad4198c747fc12eb06fc1ec0e4.tar.lz yt-local-dc6c370152d063ad4198c747fc12eb06fc1ec0e4.tar.xz yt-local-dc6c370152d063ad4198c747fc12eb06fc1ec0e4.zip |
Extraction: refactor response extraction to work with both mobile & desktop respones, also improve errors
Diffstat (limited to 'youtube/channel.py')
-rw-r--r-- | youtube/channel.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube/channel.py b/youtube/channel.py index 3a2a0b3..67a79ad 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -186,8 +186,8 @@ def get_channel_page(channel_id, tab='videos'): info = yt_data_extract.extract_channel_info(json.loads(polymer_json), tab) - if info['errors']: - return flask.render_template('error.html', error_message = '\n'.join(info['errors'])) + if info['error']: + return flask.render_template('error.html', error_message = info['error']) post_process_channel_info(info) if tab in ('videos', 'search'): info['number_of_videos'] = number_of_videos @@ -228,8 +228,8 @@ def get_channel_page_general_url(base_url, tab, request): info = yt_data_extract.extract_channel_info(json.loads(polymer_json), tab) - if info['errors']: - return flask.render_template('error.html', error_message = '\n'.join(info['errors'])) + if info['error']: + return flask.render_template('error.html', error_message = info['error']) post_process_channel_info(info) if tab in ('videos', 'search'): |