mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
[imgur] fix
This commit is contained in:
parent
e0615e31e0
commit
da1d772cd8
@ -52,20 +52,16 @@ class Imgur(VideoExtractor):
|
|||||||
else:
|
else:
|
||||||
# gallery image
|
# gallery image
|
||||||
content = get_content(self.url)
|
content = get_content(self.url)
|
||||||
image = json.loads(match1(content, r'image\s*:\s*({.*}),'))
|
url = match1(content, r'(https?://i.imgur.com/[^"]+)')
|
||||||
ext = image['ext']
|
_, container, size = url_info(url)
|
||||||
self.streams = {
|
self.streams = {
|
||||||
'original': {
|
'original': {
|
||||||
'src': ['http://i.imgur.com/%s%s' % (image['hash'], ext)],
|
'src': [url],
|
||||||
'size': image['size'],
|
'size': size,
|
||||||
'container': ext[1:]
|
'container': container
|
||||||
},
|
|
||||||
'thumbnail': {
|
|
||||||
'src': ['http://i.imgur.com/%ss%s' % (image['hash'], '.jpg')],
|
|
||||||
'container': 'jpg'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.title = image['title'] or image['hash']
|
self.title = r1(r'i\.imgur\.com/([^./]*)', url)
|
||||||
|
|
||||||
def extract(self, **kwargs):
|
def extract(self, **kwargs):
|
||||||
if 'stream_id' in kwargs and kwargs['stream_id']:
|
if 'stream_id' in kwargs and kwargs['stream_id']:
|
||||||
|
Loading…
Reference in New Issue
Block a user