]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/mwave.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from ..compat
import compat_str
11 class MwaveIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://mwave\.interest\.me/mnettv/videodetail\.m\?searchVideoDetailVO\.clip_id=(?P<id>[0-9]+)'
13 _URL_TEMPLATE
= 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=%s'
15 'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168859',
20 'title': '[M COUNTDOWN] SISTAR - SHAKE IT',
21 'thumbnail': 're:^https?://.*\.jpg$',
22 'uploader': 'M COUNTDOWN',
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
31 vod_info
= self
._download
_json
(
32 'http://mwave.interest.me/onair/vod_info.m?vodtype=CL§orid=&endinfo=Y&id=%s' % video_id
,
33 video_id
, 'Download vod JSON')
36 for num
, cdn_info
in enumerate(vod_info
['cdn']):
37 stream_url
= cdn_info
.get('url')
40 stream_name
= cdn_info
.get('name') or compat_str(num
)
41 f4m_stream
= self
._download
_json
(
43 'Download %s stream JSON' % stream_name
)
44 f4m_url
= f4m_stream
.get('fileurl')
48 self
._extract
_f
4m
_formats
(f4m_url
+ '&hdcore=3.0.3', video_id
, f4m_id
=stream_name
))
49 self
._sort
_formats
(formats
)
53 'title': vod_info
['title'],
54 'thumbnail': vod_info
.get('cover'),
55 'uploader': vod_info
.get('program_title'),
56 'duration': parse_duration(vod_info
.get('time')),
57 'view_count': int_or_none(vod_info
.get('hit')),
62 class MwaveMeetGreetIE(InfoExtractor
):
63 _VALID_URL
= r
'https?://mwave\.interest\.me/meetgreet/view/(?P<id>\d+)'
65 'url': 'http://mwave.interest.me/meetgreet/view/256',
69 'title': '[MEET&GREET] Park BoRam',
70 'thumbnail': 're:^https?://.*\.jpg$',
77 def _real_extract(self
, url
):
78 video_id
= self
._match
_id
(url
)
79 webpage
= self
._download
_webpage
(url
, video_id
)
80 clip_id
= self
._html
_search
_regex
(
81 r
'<iframe[^>]+src="/mnettv/ifr_clip\.m\?searchVideoDetailVO\.clip_id=(\d+)',
83 clip_url
= MwaveIE
._URL
_TEMPLATE
% clip_id
84 return self
.url_result(clip_url
, 'Mwave', clip_id
)