From 81ff5ab99ca05c4559c604ba7517d17f4bc79ea8 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 11 Aug 2020 19:47:37 -0700 Subject: extract_channel_info: Improve error extraction Use extract_str function since it's not always 'simpleText' Make sure we don't output an empty error message if we don't know what it is. channel.py: Don't check if error message is empty, check if it's None --- youtube/channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube/channel.py') diff --git a/youtube/channel.py b/youtube/channel.py index 394ce1b..153760b 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -203,7 +203,7 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None): info = yt_data_extract.extract_channel_info(json.loads(polymer_json), tab) - if info['error']: + if info['error'] is not None: return flask.render_template('error.html', error_message = info['error']) post_process_channel_info(info) -- cgit v1.2.3