[StreetVoice] Add new extractor

This commit is contained in:
Yen Chi Hsuan 2015-01-21 23:05:47 +08:00
parent 47e0e1e0e2
commit c8dc41a6e7
2 changed files with 37 additions and 0 deletions

View File

@ -409,6 +409,7 @@ from .stanfordoc import StanfordOpenClassroomIE
from .steam import SteamIE
from .streamcloud import StreamcloudIE
from .streamcz import StreamCZIE
from .streetvoice import StreetVoiceIE
from .sunporno import SunPornoIE
from .swrmediathek import SWRMediathekIE
from .syfy import SyfyIE

View File

@ -0,0 +1,36 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class StreetVoiceIE(InfoExtractor):
_VALID_URL = r'http://tw.streetvoice.com/[^/]+/songs/(?P<id>[0-9]+)/'
_TESTS = [
{
'url': 'http://tw.streetvoice.com/skippylu/songs/94440/',
'md5': '15974627fc01a29e492c98593c2fd472',
'info_dict': {
'id': '94440',
'ext': 'mp3',
'title': '',
'description': '輸 - Crispy脆樂團'
}
}
]
def _real_extract(self, url):
song_id = self._match_id(url)
api_url = 'http://tw.streetvoice.com/music/api/song/%s/' % song_id
info_dict = self._download_json(api_url, song_id)
author = info_dict['musician']['name']
title = info_dict['name']
return {
'id': song_id,
'ext': 'mp3',
'title': title,
'url': info_dict['file'],
'description': '%s - %s' % (title, author)
}