aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-07-27 23:58:44 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-07-27 23:58:44 -0700
commita28b81bfafe46dd01d67ca62a8c59c3922ae3fd7 (patch)
tree9e931518faebdd8036f9ed62afa7dbd671f12c7d
parent2289089ec63e0ee73afea5151051f460d5dfe6e1 (diff)
downloadyt-local-a28b81bfafe46dd01d67ca62a8c59c3922ae3fd7.tar.lz
yt-local-a28b81bfafe46dd01d67ca62a8c59c3922ae3fd7.tar.xz
yt-local-a28b81bfafe46dd01d67ca62a8c59c3922ae3fd7.zip
fix channel about page error when has no links
-rw-r--r--youtube/channel.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube/channel.py b/youtube/channel.py
index c229cb0..bac78be 100644
--- a/youtube/channel.py
+++ b/youtube/channel.py
@@ -241,7 +241,7 @@ def channel_about_page(polymer_json):
# my goodness...
channel_metadata = tab_with_content(polymer_json[1]['response']['contents']['twoColumnBrowseResultsRenderer']['tabs'])['sectionListRenderer']['contents'][0]['itemSectionRenderer']['contents'][0]['channelAboutFullMetadataRenderer']
channel_links = ''
- for link_json in channel_metadata['primaryLinks']:
+ for link_json in channel_metadata.get('primaryLinks', ()):
channel_links += channel_link_template.substitute(
url = html.escape(link_json['navigationEndpoint']['urlEndpoint']['url']),
text = common.get_plain_text(link_json['title']),