1 from .common
import InfoExtractor
2 from ..utils
import ExtractorError
5 class YinYueTaiIE(InfoExtractor
):
6 IE_NAME
= 'yinyuetai:video'
8 _VALID_URL
= r
'https?://v\.yinyuetai\.com/video(?:/h5)?/(?P<id>[0-9]+)'
10 'url': 'http://v.yinyuetai.com/video/2322376',
11 'md5': '6e3abe28d38e3a54b591f9f040595ce0',
15 'title': '少女时代_PARTY_Music Video Teaser',
18 'thumbnail': r
're:^https?://.*\.jpg$',
21 'url': 'http://v.yinyuetai.com/video/h5/2322376',
22 'only_matching': True,
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
28 info
= self
._download
_json
(
29 'http://ext.yinyuetai.com/main/get-h-mv-info?json=true&videoId=%s' % video_id
, video_id
,
30 'Downloading mv info')['videoInfo']['coreVideoInfo']
33 raise ExtractorError(info
['errorMsg'], expected
=True)
36 'url': format_info
['videoUrl'],
37 'format_id': format_info
['qualityLevel'],
38 'format': format_info
.get('qualityLevelName'),
39 'filesize': format_info
.get('fileSize'),
40 # though URLs ends with .flv, the downloaded files are in fact mp4
42 'tbr': format_info
.get('bitrate'),
43 } for format_info
in info
['videoUrlModels']]
47 'title': info
['videoName'],
48 'thumbnail': info
.get('bigHeadImage'),
49 'creator': info
.get('artistNames'),
50 'duration': info
.get('duration'),