diff options
author | ping <lipng.ong@gmail.com> | 2015-06-05 06:04:26 +0800 |
---|---|---|
committer | ping <lipng.ong@gmail.com> | 2015-06-05 06:04:26 +0800 |
commit | 8b8cde21406b53f5aeb6586dab03a9d78d62e631 (patch) | |
tree | 64f7faad40839d981013c1a129606c4df9b0328c | |
parent | 55e5841f14131ab61359535fdcc44e1564d555b8 (diff) |
[qqmusic] Set abr for mp3 formats
-rw-r--r-- | youtube_dl/extractor/qqmusic.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/youtube_dl/extractor/qqmusic.py b/youtube_dl/extractor/qqmusic.py index 4b4ef4993..dc300e189 100644 --- a/youtube_dl/extractor/qqmusic.py +++ b/youtube_dl/extractor/qqmusic.py @@ -31,8 +31,8 @@ class QQMusicIE(InfoExtractor): }] _FORMATS = { - 'mp3-320': {'prefix': 'M800', 'ext': 'mp3', 'preference': 40}, - 'mp3-128': {'prefix': 'M500', 'ext': 'mp3', 'preference': 30}, + 'mp3-320': {'prefix': 'M800', 'ext': 'mp3', 'preference': 40, 'abr': 320}, + 'mp3-128': {'prefix': 'M500', 'ext': 'mp3', 'preference': 30, 'abr': 128}, 'm4a': {'prefix': 'C200', 'ext': 'm4a', 'preference': 10} } @@ -77,11 +77,12 @@ class QQMusicIE(InfoExtractor): transform_source=strip_jsonp)['key'] formats = [] - for k, sf in self._FORMATS.items(): + for k, f in self._FORMATS.items(): formats.append({ 'url': 'http://cc.stream.qqmusic.qq.com/%s%s.%s?vkey=%s&guid=%s&fromtag=0' - % (sf['prefix'], mid, sf['ext'], vkey, guid), - 'format': k, 'format_id': k, 'preference': sf['preference'] + % (f['prefix'], mid, f['ext'], vkey, guid), + 'format': k, 'format_id': k, 'preference': f['preference'], + 'abr': f.get('abr') }) self._sort_formats(formats) |