]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/melonvod.py
1 from .common
import InfoExtractor
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',
15 'title': "Jessica 'Wonderland' MV Making Film",
16 'thumbnail': r
're:^https?://.*\.jpg$',
17 'artist': 'Jessica (์ ์์นด)',
18 'upload_date': '20161212',
22 'skip_download': 'm3u8 download',
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
29 play_info
= self
._download
_json
(
30 'http://vod.melon.com/video/playerInfo.json', video_id
,
31 note
='Downloading player info JSON', query
={'mvId': video_id}
)
33 title
= play_info
['mvInfo']['MVTITLE']
35 info
= self
._download
_json
(
36 'http://vod.melon.com/delivery/streamingInfo.json', video_id
,
37 note
='Downloading streaming info JSON',
43 stream_info
= info
['streamingInfo']
45 formats
= self
._extract
_m
3u8_formats
(
46 stream_info
['encUrl'], video_id
, 'mp4', m3u8_id
='hls')
47 self
._sort
_formats
(formats
)
49 artist_list
= play_info
.get('artistList')
51 if isinstance(artist_list
, list):
53 [a
['ARTISTNAMEWEBLIST']
54 for a
in artist_list
if a
.get('ARTISTNAMEWEBLIST')])
56 thumbnail
= urljoin(info
.get('staticDomain'), stream_info
.get('imgPath'))
58 duration
= int_or_none(stream_info
.get('playTime'))
59 upload_date
= stream_info
.get('mvSvcOpenDt', '')[:8] or None
65 'thumbnail': thumbnail
,
66 'upload_date': upload_date
,