youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit edb99d4c18475ba27fae4f7d0ec6e3db9b574885
parent 68477c3dab97733eb7a2feb8fcc90f648c29c2b4
Author: Yen Chi Hsuan <yan12125@gmail.com>
Date:   Mon,  8 Jun 2015 01:17:21 +0800

[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)

Diffstat:
Myoutube_dl/extractor/instagram.py | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 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'],