Regression: Fix channel extraction 'items' key not present when there's no items.

Examples: Empty channels, no search results
This commit is contained in:
James Taylor 2019-12-23 15:07:03 -08:00
parent 777ed756dc
commit 9737ffcf82

View File

@ -52,12 +52,13 @@ def extract_channel_info(polymer_json, tab):
else:
info['channel_url'] = None
# get items
info['items'] = []
# empty channel
if 'contents' not in response and 'continuationContents' not in response:
return info
# get items
info['items'] = []
if tab in ('videos', 'playlists', 'search'):
items, ctoken = extract_items(response)
additional_info = {'author': info['channel_name'], 'author_url': info['channel_url']}