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