]>
jfr.im git - yt-dlp.git/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]+)'
14 'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168859',
19 'title': '[M COUNTDOWN] SISTAR - SHAKE IT',
20 'thumbnail': 're:^https?://.*\.jpg$',
21 'uploader': 'M COUNTDOWN',
27 def _real_extract(self
, url
):
28 video_id
= self
._match
_id
(url
)
30 vod_info
= self
._download
_json
(
31 'http://mwave.interest.me/onair/vod_info.m?vodtype=CL§orid=&endinfo=Y&id=%s' % video_id
,
32 video_id
, 'Download vod JSON')
35 for num
, cdn_info
in enumerate(vod_info
['cdn']):
36 stream_url
= cdn_info
.get('url')
39 stream_name
= cdn_info
.get('name') or compat_str(num
)
40 f4m_stream
= self
._download
_json
(
42 'Download %s stream JSON' % stream_name
)
43 f4m_url
= f4m_stream
.get('fileurl')
47 self
._extract
_f
4m
_formats
(f4m_url
+ '&hdcore=3.0.3', video_id
, f4m_id
=stream_name
))
48 self
._sort
_formats
(formats
)
52 'title': vod_info
['title'],
53 'thumbnail': vod_info
.get('cover'),
54 'uploader': vod_info
.get('program_title'),
55 'duration': parse_duration(vod_info
.get('time')),
56 'view_count': int_or_none(vod_info
.get('hit')),
61 class MwaveMeetGreetIE(InfoExtractor
):
62 _VALID_URL
= r
'https?://mwave\.interest\.me/meetgreet/view/(?P<id>[0-9]+)'
64 'url': 'http://mwave.interest.me/meetgreet/view/256',
68 'title': '[MEET&GREET] Park BoRam',
69 'thumbnail': 're:^https?://.*\.jpg$',
76 def _real_extract(self
, url
):
77 video_id
= self
._match
_id
(url
)
78 webpage
= self
._download
_webpage
(url
, video_id
)
79 clip_id
= self
._html
_search
_regex
(r
'<iframe src="/mnettv/ifr_clip\.m\?searchVideoDetailVO\.clip_id=(?P<id>[0-9]+)', webpage
, 'clip ID')
80 clip_url
= 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id={0}'.format(clip_id
)
81 return self
.url_result(clip_url
, 'Mwave', clip_id
)