not returning list in case of single images.

This commit is contained in:
Abhishek Kedia 2015-12-21 17:17:57 +01:00
parent 6a5bcb2cab
commit 133643c36c
2 changed files with 5 additions and 3 deletions

View File

@ -1 +0,0 @@
{"display_id": "YcAQlkx", "extractor": "ImgurAlbum", "playlist": null, "format": "0 - unknown", "url": "http://imgur.com/YcAQlkx", "extractor_key": "ImgurAlbum", "title": "Classic Steve Carell gif...cracks me up everytime....damn the repost downvotes....", "playlist_index": null, "ext": "unknown_video", "fulltitle": "Classic Steve Carell gif...cracks me up everytime....damn the repost downvotes....", "webpage_url": "https://imgur.com/gallery/YcAQlkx", "_filename": "YcAQlkx.unknown_video", "format_id": "0", "http_headers": {"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/20.0 (Chrome)"}, "id": "YcAQlkx", "webpage_url_basename": "YcAQlkx"}

View File

@ -112,8 +112,11 @@ class ImgurAlbumIE(InfoExtractor):
'url': 'https://imgur.com/gallery/YcAQlkx',
'info_dict': {
'id': 'YcAQlkx',
'ext': 'mp4',
'title': 'Classic Steve Carell gif...cracks me up everytime....damn the repost downvotes....',
'description': 'Imgur: The most awesome images on the Internet.'
},
'playlist_count': 1,
}]
def _real_extract(self, url):
@ -123,7 +126,7 @@ class ImgurAlbumIE(InfoExtractor):
'http://imgur.com/gallery/%s/album_images/hit.json?all=true' % album_id, album_id)['data']
if len(album_img_data) == 0:
entries = [self.url_result('http://imgur.com/%s' % album_id)]
return self.url_result('http://imgur.com/%s' % album_id)
else:
album_images = album_img_data['images']
entries = [