]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/mwave.py
1 from .common
import InfoExtractor
2 from ..compat
import compat_str
9 class MwaveIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://mwave\.interest\.me/(?:[^/]+/)?mnettv/videodetail\.m\?searchVideoDetailVO\.clip_id=(?P<id>[0-9]+)'
11 _URL_TEMPLATE
= 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=%s'
13 'url': 'http://mwave.interest.me/mnettv/videodetail.m?searchVideoDetailVO.clip_id=168859',
18 'title': '[M COUNTDOWN] SISTAR - SHAKE IT',
19 'thumbnail': r
're:^https?://.*\.jpg$',
20 'uploader': 'M COUNTDOWN',
25 'url': 'http://mwave.interest.me/en/mnettv/videodetail.m?searchVideoDetailVO.clip_id=176199',
26 'only_matching': True,
29 def _real_extract(self
, url
):
30 video_id
= self
._match
_id
(url
)
32 vod_info
= self
._download
_json
(
33 'http://mwave.interest.me/onair/vod_info.m?vodtype=CL§orid=&endinfo=Y&id=%s' % video_id
,
34 video_id
, 'Download vod JSON')
37 for num
, cdn_info
in enumerate(vod_info
['cdn']):
38 stream_url
= cdn_info
.get('url')
41 stream_name
= cdn_info
.get('name') or compat_str(num
)
42 f4m_stream
= self
._download
_json
(
44 'Download %s stream JSON' % stream_name
)
45 f4m_url
= f4m_stream
.get('fileurl')
49 self
._extract
_f
4m
_formats
(f4m_url
+ '&hdcore=3.0.3', video_id
, f4m_id
=stream_name
))
50 self
._sort
_formats
(formats
)
54 'title': vod_info
['title'],
55 'thumbnail': vod_info
.get('cover'),
56 'uploader': vod_info
.get('program_title'),
57 'duration': parse_duration(vod_info
.get('time')),
58 'view_count': int_or_none(vod_info
.get('hit')),
63 class MwaveMeetGreetIE(InfoExtractor
):
64 _VALID_URL
= r
'https?://mwave\.interest\.me/(?:[^/]+/)?meetgreet/view/(?P<id>\d+)'
66 'url': 'http://mwave.interest.me/meetgreet/view/256',
70 'title': '[MEET&GREET] Park BoRam',
71 'thumbnail': r
're:^https?://.*\.jpg$',
77 'url': 'http://mwave.interest.me/en/meetgreet/view/256',
78 'only_matching': True,
81 def _real_extract(self
, url
):
82 video_id
= self
._match
_id
(url
)
83 webpage
= self
._download
_webpage
(url
, video_id
)
84 clip_id
= self
._html
_search
_regex
(
85 r
'<iframe[^>]+src="/mnettv/ifr_clip\.m\?searchVideoDetailVO\.clip_id=(\d+)',
87 clip_url
= MwaveIE
._URL
_TEMPLATE
% clip_id
88 return self
.url_result(clip_url
, 'Mwave', clip_id
)