From 9ee9f4e7b6aaf3f1119f6492369808d2aba41716 Mon Sep 17 00:00:00 2001 From: woorst Date: Wed, 31 May 2017 16:04:02 -0500 Subject: [PATCH] check response status --- rtv/mime_parsers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rtv/mime_parsers.py b/rtv/mime_parsers.py index a14802a..76d1517 100644 --- a/rtv/mime_parsers.py +++ b/rtv/mime_parsers.py @@ -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