check response status

This commit is contained in:
woorst
2017-05-31 16:04:02 -05:00
parent b9849fe3d2
commit 9ee9f4e7b6

View File

@@ -199,8 +199,10 @@ class VidmeMIMEParser(BaseMIMEParser):
@staticmethod
def get_mimetype(url):
resp = requests.get('https://api.vid.me/videoByUrl?url=' + url)
video_url = resp.json()['video']['complete_url']
return video_url, 'video/mp4'
if resp.json()['status']:
return resp.json()['video']['complete_url'], 'video/mp4'
else:
url, None
# Parsers should be listed in the order they will be checked