From a28b81bfafe46dd01d67ca62a8c59c3922ae3fd7 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Fri, 27 Jul 2018 23:58:44 -0700 Subject: fix channel about page error when has no links --- 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 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']), -- cgit v1.2.3