diff options
author | Georg Jaehnig <georg@jaehnig.org> | 2014-05-30 17:51:36 +0200 |
---|---|---|
committer | Georg Jaehnig <georg@jaehnig.org> | 2014-05-30 17:51:36 +0200 |
commit | 0cdf576d86418273e604c43cc0d9a63a685bdc7c (patch) | |
tree | 2515595c0abf4b9195cb3a4b00a89718f8dad224 /youtube_dl/extractor/spiegeltv.py | |
parent | 4ffeca4ea29fe75821c8de5fbaf8d8f585f2dbb4 (diff) |
use provided function to get JSON
Diffstat (limited to 'youtube_dl/extractor/spiegeltv.py')
-rw-r--r-- | youtube_dl/extractor/spiegeltv.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/youtube_dl/extractor/spiegeltv.py b/youtube_dl/extractor/spiegeltv.py index e8f49bc52..f8265d042 100644 --- a/youtube_dl/extractor/spiegeltv.py +++ b/youtube_dl/extractor/spiegeltv.py @@ -2,8 +2,6 @@ from __future__ import unicode_literals import re -import json -import urllib from .common import InfoExtractor class SpiegeltvIE(InfoExtractor): @@ -28,22 +26,17 @@ class SpiegeltvIE(InfoExtractor): apihost = 'http://spiegeltv-ivms2-restapi.s3.amazonaws.com'; - version_json_code = urllib.urlopen('%s/version.json' % apihost).read() - version_json = json.loads(version_json_code) + version_json = self._download_json('%s/version.json' % apihost, None) version_name = version_json['version_name'] - slug_json_code = urllib.urlopen('%s/%s/restapi/slugs/%s.json' % (apihost, version_name, video_id)).read() - slug_json = json.loads(slug_json_code) + slug_json = self._download_json('%s/%s/restapi/slugs/%s.json' % (apihost, version_name, video_id), None) oid = slug_json['object_id'] - media_json_code = urllib.urlopen('%s/%s/restapi/media/%s.json' % (apihost, version_name, oid)).read() - media_json = json.loads(media_json_code) - + media_json = self._download_json('%s/%s/restapi/media/%s.json' % (apihost, version_name, oid), None) uuid = media_json['uuid'] is_wide = media_json['is_wide'] - server_json_code = urllib.urlopen('http://www.spiegel.tv/streaming_servers/').read() - server_json = json.loads(server_json_code) + server_json = self._download_json('http://www.spiegel.tv/streaming_servers/', None) server = server_json[0]['endpoint'] thumbnails = [] |