get_artist, get_user: fail silently if playlistId or thumbnails are missing for video

This commit is contained in:
sigma67 2021-05-17 13:46:05 +02:00
commit e6139ce12e
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0

View file

@ -182,8 +182,8 @@ def parse_video(result):
video = {
'title': nav(result, TITLE_TEXT),
'videoId': nav(result, NAVIGATION_VIDEO_ID),
'playlistId': nav(result, NAVIGATION_PLAYLIST_ID),
'thumbnails': nav(result, THUMBNAIL_RENDERER)
'playlistId': nav(result, NAVIGATION_PLAYLIST_ID, True),
'thumbnails': nav(result, THUMBNAIL_RENDERER, True)
}
if len(result['subtitle']['runs']) == 3:
video['views'] = nav(result, SUBTITLE2).split(' ')[0]