From cb4e56e0c6fa805301b590b390f8238bdc9e2a42 Mon Sep 17 00:00:00 2001 From: woorst Date: Mon, 29 May 2017 11:46:18 -0500 Subject: [PATCH] use request json method --- rtv/mime_parsers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rtv/mime_parsers.py b/rtv/mime_parsers.py index 469f6ec..e358082 100644 --- a/rtv/mime_parsers.py +++ b/rtv/mime_parsers.py @@ -4,7 +4,6 @@ import mimetypes import requests from bs4 import BeautifulSoup -import json _logger = logging.getLogger(__name__) @@ -130,7 +129,7 @@ class ImgurMIMEParser(BaseMIMEParser): if r.status_code != 200: return url, None - data = json.loads(r.text)['data'] + data = r.json()['data'] if 'images' in data: # TODO: handle imgur albums with mixed content, i.e. jpeg and gifv links = ' '.join([d['link'] for d in data['images'] if not d['animated']])