aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-06-25 16:15:13 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-06-25 16:15:13 +0800
commit2182ab5187736f806f1a2ce959c3893179bdd1a2 (patch)
tree962694e25953d3363df28768c269a0f53160916b /youtube_dl/extractor
parenta1593a4a0e0f278d15ebda603df8c69679bb34c9 (diff)
[thesixtyone] Fix audio_server
Some of the songs are moved to Amazon AWS
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/thesixtyone.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/thesixtyone.py b/youtube_dl/extractor/thesixtyone.py
index a77c6a2fc..e1be978a4 100644
--- a/youtube_dl/extractor/thesixtyone.py
+++ b/youtube_dl/extractor/thesixtyone.py
@@ -17,7 +17,7 @@ class TheSixtyOneIE(InfoExtractor):
song
)/(?P<id>[A-Za-z0-9]+)/?$'''
_SONG_URL_TEMPLATE = 'http://thesixtyone.com/s/{0:}'
- _SONG_FILE_URL_TEMPLATE = 'http://{audio_server:}.thesixtyone.com/thesixtyone_production/audio/{0:}_stream'
+ _SONG_FILE_URL_TEMPLATE = 'http://{audio_server:}/thesixtyone_production/audio/{0:}_stream'
_THUMBNAIL_URL_TEMPLATE = '{photo_base_url:}_desktop'
_TESTS = [
{
@@ -78,6 +78,12 @@ class TheSixtyOneIE(InfoExtractor):
song_data = json.loads(self._search_regex(
r'"%s":\s(\{.*?\})' % song_id, webpage, 'song_data'))
+
+ 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'
+ else:
+ song_data['audio_server'] = song_data['audio_server'] + '.thesixtyone.com'
+
keys = [self._DECODE_MAP.get(s, s) for s in song_data['key']]
url = self._SONG_FILE_URL_TEMPLATE.format(
"".join(reversed(keys)), **song_data)