aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-07-23 22:36:43 -0700
committerJames Taylor <user234683@users.noreply.github.com>2019-07-23 22:36:43 -0700
commitfe38aa214bc8876e80de08d3f3f793fa2f546ef4 (patch)
treec93f956d555e8fff583eab344c146e0f362ad058
parent2034b6bd251baf52998ce8a81c7016f91e711302 (diff)
downloadyt-local-fe38aa214bc8876e80de08d3f3f793fa2f546ef4.tar.lz
yt-local-fe38aa214bc8876e80de08d3f3f793fa2f546ef4.tar.xz
yt-local-fe38aa214bc8876e80de08d3f3f793fa2f546ef4.zip
Fix error when channel has empty description
-rw-r--r--youtube/channel.py6
1 files changed, 4 insertions, 2 deletions
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)