[instagram] Handling null values (fixes #5919)
I didn't add the test case here because it takes too much time. (7 minutes on my machine)
This commit is contained in:
parent
68477c3dab
commit
edb99d4c18
1 changed files with 3 additions and 1 deletions
|
@ -100,7 +100,9 @@ class InstagramUserIE(InfoExtractor):
|
||||||
thumbnails_el = it.get('images', {})
|
thumbnails_el = it.get('images', {})
|
||||||
thumbnail = thumbnails_el.get('thumbnail', {}).get('url')
|
thumbnail = thumbnails_el.get('thumbnail', {}).get('url')
|
||||||
|
|
||||||
title = it.get('caption', {}).get('text', it['id'])
|
# In some cases caption is null, which corresponds to None
|
||||||
|
# in python. As a result, it.get('caption', {}) gives None
|
||||||
|
title = (it.get('caption') or {}).get('text', it['id'])
|
||||||
|
|
||||||
entries.append({
|
entries.append({
|
||||||
'id': it['id'],
|
'id': it['id'],
|
||||||
|
|
Loading…
Reference in a new issue