yt_data_ext: watch playlist: Fix missing author_url if no author_id

Embedded playlist info was missing author_url key if author_id was
None. This caused KeyError in watch.py when it expected that key

Closes #37
This commit is contained in:
James Taylor 2020-11-08 10:08:20 -08:00
parent 2388b372ae
commit 0589cfb8f7

View File

@ -177,7 +177,6 @@ def _extract_watch_info_mobile(top_level):
author_id = deep_get(playlist, 'longBylineText', 'runs', 0,
'navigationEndpoint', 'browseEndpoint', 'browseId')
info['playlist']['author_id'] = author_id
if author_id:
info['playlist']['author_url'] = concat_or_none(
'https://www.youtube.com/channel/', author_id)
info['playlist']['id'] = playlist.get('playlistId')