expand gfycat mime parser for more urls

This commit is contained in:
woorst
2017-09-02 23:46:31 -05:00
parent d6735f7181
commit 52229b1578

View File

@@ -77,7 +77,7 @@ class GfycatMIMEParser(BaseMIMEParser):
@staticmethod
def get_mimetype(url):
parts = url.split('/')
parts = url.replace('gifs/detail/', '').split('/')
api_url = '/'.join(parts[:-1] + ['cajax', 'get'] + parts[-1:])
resp = requests.get(api_url)
image_url = resp.json()['gfyItem']['webmUrl']