projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68477c3
)
[instagram] Handling null values (fixes #5919)
author
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 7 Jun 2015 17:17:21 +0000
(
01:17
+0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 7 Jun 2015 17:17:21 +0000
(
01:17
+0800)
I didn't add the test case here because it takes too much time. (7
minutes on my machine)
youtube_dl/extractor/instagram.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/instagram.py
b/youtube_dl/extractor/instagram.py
index b107557880345157fcf66cb7e6e1b4a92b25af2e..b92367a9d7ba6f708a8780d645336fb8cda37418 100644
(file)
--- a/
youtube_dl/extractor/instagram.py
+++ b/
youtube_dl/extractor/instagram.py
@@
-100,7
+100,9
@@
class InstagramUserIE(InfoExtractor):
thumbnails_el = it.get('images', {})
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({
'id': it['id'],