Regression: Fix channel extraction 'items' key not present when there's no items.
Examples: Empty channels, no search results
This commit is contained in:
parent
777ed756dc
commit
9737ffcf82
@ -52,12 +52,13 @@ def extract_channel_info(polymer_json, tab):
|
|||||||
else:
|
else:
|
||||||
info['channel_url'] = None
|
info['channel_url'] = None
|
||||||
|
|
||||||
|
# get items
|
||||||
|
info['items'] = []
|
||||||
|
|
||||||
# empty channel
|
# empty channel
|
||||||
if 'contents' not in response and 'continuationContents' not in response:
|
if 'contents' not in response and 'continuationContents' not in response:
|
||||||
return info
|
return info
|
||||||
|
|
||||||
# get items
|
|
||||||
info['items'] = []
|
|
||||||
if tab in ('videos', 'playlists', 'search'):
|
if tab in ('videos', 'playlists', 'search'):
|
||||||
items, ctoken = extract_items(response)
|
items, ctoken = extract_items(response)
|
||||||
additional_info = {'author': info['channel_name'], 'author_url': info['channel_url']}
|
additional_info = {'author': info['channel_name'], 'author_url': info['channel_url']}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user