From fe38aa214bc8876e80de08d3f3f793fa2f546ef4 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 23 Jul 2019 22:36:43 -0700 Subject: Fix error when channel has empty description --- youtube/channel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'youtube') diff --git a/youtube/channel.py b/youtube/channel.py index fe5af8c..4f719ae 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -251,8 +251,10 @@ def extract_info(polymer_json, tab): continue info['stats'].append(yt_data_extract.get_plain_text(stat)) - - info['description'] = yt_data_extract.get_text(channel_metadata['description']) + if 'description' in channel_metadata: + info['description'] = yt_data_extract.get_text(channel_metadata['description']) + else: + info['description'] = '' else: raise NotImplementedError('Unknown or unsupported channel tab: ' + tab) -- cgit v1.2.3