Merge pull request #426 from woorst/mime_parser_gfycat_update
expand gfycat mime parser for more urls
This commit is contained in:
@@ -77,7 +77,7 @@ class GfycatMIMEParser(BaseMIMEParser):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_mimetype(url):
|
def get_mimetype(url):
|
||||||
parts = url.split('/')
|
parts = url.replace('gifs/detail/', '').split('/')
|
||||||
api_url = '/'.join(parts[:-1] + ['cajax', 'get'] + parts[-1:])
|
api_url = '/'.join(parts[:-1] + ['cajax', 'get'] + parts[-1:])
|
||||||
resp = requests.get(api_url)
|
resp = requests.get(api_url)
|
||||||
image_url = resp.json()['gfyItem']['webmUrl']
|
image_url = resp.json()['gfyItem']['webmUrl']
|
||||||
|
|||||||
Reference in New Issue
Block a user