fix channel about page error when has no links

This commit is contained in:
James Taylor 2018-07-27 23:58:44 -07:00
parent 2289089ec6
commit a28b81bfaf

View File

@ -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']),