diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-06-25 16:19:04 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-06-25 16:19:04 +0800 |
commit | 381c06775598da9667548fcc45d5df7a03748f7d (patch) | |
tree | 36368c3ffafbacf21d06eff231d2192421c24225 /youtube_dl/extractor/thesixtyone.py | |
parent | 2182ab5187736f806f1a2ce959c3893179bdd1a2 (diff) |
[thesixtyone] Modernize
Diffstat (limited to 'youtube_dl/extractor/thesixtyone.py')
-rw-r--r-- | youtube_dl/extractor/thesixtyone.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/youtube_dl/extractor/thesixtyone.py b/youtube_dl/extractor/thesixtyone.py index e1be978a4..5d09eb9a8 100644 --- a/youtube_dl/extractor/thesixtyone.py +++ b/youtube_dl/extractor/thesixtyone.py @@ -1,9 +1,6 @@ # coding: utf-8 from __future__ import unicode_literals -import json -import re - from .common import InfoExtractor from ..utils import unified_strdate @@ -70,14 +67,13 @@ class TheSixtyOneIE(InfoExtractor): } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - song_id = mobj.group('id') + song_id = self._match_id(url) webpage = self._download_webpage( self._SONG_URL_TEMPLATE.format(song_id), song_id) - song_data = json.loads(self._search_regex( - r'"%s":\s(\{.*?\})' % song_id, webpage, 'song_data')) + song_data = self._parse_json(self._search_regex( + r'"%s":\s(\{.*?\})' % song_id, webpage, 'song_data'), song_id) if self._search_regex(r'(t61\.s3_audio_load\s*=\s*1\.0;)', webpage, 's3_audio_load marker', default=None): song_data['audio_server'] = 's3.amazonaws.com' |