diff options
author | ping <lipng.ong@gmail.com> | 2015-07-22 14:31:29 +0800 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-08-19 22:40:40 +0600 |
commit | 7900aede14d2e2a46c8fd4430e48cde41f354859 (patch) | |
tree | bf00819acee785d5790e467b479eebdd4914dd73 /youtube_dl/extractor | |
parent | ca681f7041838fa215f8ab5266cd7b442f3f9445 (diff) | |
download | youtube-dl-7900aede14d2e2a46c8fd4430e48cde41f354859.tar.xz |
[mwave] New extractor for mwave.interest.me
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/__init__.py | 1 | ||||
-rw-r--r-- | youtube_dl/extractor/mwave.py | 46 |
2 files changed, 47 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index c8c9f1855..006ef3922 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -345,6 +345,7 @@ from .muenchentv import MuenchenTVIE from .musicplayon import MusicPlayOnIE from .musicvault import MusicVaultIE from .muzu import MuzuTVIE +from .mwave import MwaveIE from .myspace import MySpaceIE, MySpaceAlbumIE from .myspass import MySpassIE from .myvi import MyviIE diff --git a/youtube_dl/extractor/mwave.py b/youtube_dl/extractor/mwave.py new file mode 100644 index 000000000..7f91aa269 --- /dev/null +++ b/youtube_dl/extractor/mwave.py @@ -0,0 +1,46 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class MwaveIE(InfoExtractor): + IE_NAME = 'mwave' + _VALID_URL = r'https?://mwave\.interest\.me/mnettv/videodetail\.m\?searchVideoDetailVO\.clip_id=(?P<id>[0-9]+)' + _TESTS = [{ + 'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168859', + 'info_dict': { + 'id': '168859', + 'ext': 'flv', + 'title': '[M COUNTDOWN] SISTAR - SHAKE IT', + 'creator': 'M COUNTDOWN', + } + }, { + 'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168860', + 'info_dict': { + 'id': '168860', + 'ext': 'flv', + 'title': '[Full Ver.] M GIGS Ep. 59 - IDIOTAPE Live Part 1', + 'creator': 'M-GIGS', + } + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + + stream_info = self._download_json( + 'http://mwave.interest.me/onair/vod_info.m?vodtype=CL§orid=&endinfo=Y&id=%s' % video_id, + 'Download stream info') + + formats = [] + for info in stream_info['cdn']: + f4m_stream = self._download_json(info['url'], video_id, 'Download f4m stream') + formats.extend( + self._extract_f4m_formats(f4m_stream['fileurl'] + '&g=PCROWKHLYUDY&hdcore=3.0.3', video_id)) + self._sort_formats(formats) + + return { + 'id': video_id, + 'title': stream_info['title'], + 'creator': stream_info.get('program_title'), + 'formats': formats, + } |