2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..utils import int_or_none
8 class MelonVODIE(InfoExtractor):
9 _VALID_URL = r'https?://vod\.melon\.com/video/detail2\.html?.*mvId=(?P<id>[0-9]+)'
11 'url': 'http://vod.melon.com/video/detail2.htm?mvId=50158734',
12 'md5': '461fc04c6d23cbf49f4fef4d61851d32',
16 'title': 'Jessica \'Wonderland\' MV Making Film',
17 'thumbnail': 're:^https?://.*\.jpg$',
18 'artist': 'Jessica (์ ์์นด)',
19 'upload_date': '20161212',
23 'skip_download': 'm3u8 download',
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
30 play_info = self._download_json(
31 'http://vod.melon.com/video/playerInfo.json', video_id,
32 note='Downloading playerInfo', query={'mvId': video_id}
34 title = play_info['mvInfo']['MVTITLE']
35 artist = ', '.join([artist['ARTISTNAMEWEBLIST'] for artist in play_info.get('artistList', [])])
37 info = self._download_json(
38 'http://vod.melon.com/delivery/streamingInfo.json', video_id,
39 note='Downloading streamingInfo',
40 query={'contsId': video_id, 'contsType': 'VIDEO'}
42 stream_info = info.get('streamingInfo', {})
43 m3u8_url = stream_info.get('encUrl')
44 formats = self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', m3u8_id='hls')
45 self._sort_formats(formats)
47 thumbnail = info.get('staticDomain', '') + stream_info.get('imgPath', '')
48 duration = int_or_none(stream_info.get('playTime'))
49 upload_date = stream_info.get('mvSvcOpenDt', '')[:8]
55 'thumbnail': thumbnail,
56 'upload_date': upload_date,