diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-07-09 01:07:45 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-07-09 01:07:45 +0800 |
commit | d76dea001b5365b7646986cba12f9908cd321f6a (patch) | |
tree | fae1fa988e1993e135868b1817551825d528e42e | |
parent | af0f9b0e95233862e758140b282497d04edfb885 (diff) |
[yinyuetai] Miscellaneous improvements
1. Include all fields in _TEST
2. Use .get() for optional fields
3. Clarify the intention of 'ext' in formats
-rw-r--r-- | youtube_dl/extractor/yinyuetai.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/youtube_dl/extractor/yinyuetai.py b/youtube_dl/extractor/yinyuetai.py index a4ada4872..003df9233 100644 --- a/youtube_dl/extractor/yinyuetai.py +++ b/youtube_dl/extractor/yinyuetai.py @@ -16,6 +16,8 @@ class YinYueTaiIE(InfoExtractor): 'ext': 'mp4', 'title': '少女时代_PARTY_Music Video Teaser', 'creator': '少女时代', + 'duration': 25, + 'thumbnail': 're:^https?://.*\.jpg$', }, }, { 'url': 'http://v.yinyuetai.com/video/h5/2322376', @@ -35,18 +37,19 @@ class YinYueTaiIE(InfoExtractor): formats = [{ 'url': format_info['videoUrl'], 'format_id': format_info['qualityLevel'], - 'format': format_info['qualityLevelName'], - 'filesize': format_info['fileSize'], + 'format': format_info.get('qualityLevelName'), + 'filesize': format_info.get('fileSize'), + # though URLs ends with .flv, the downloaded files are in fact mp4 'ext': 'mp4', - 'preference': format_info['bitrate'], + 'tbr': format_info.get('bitrate'), } for format_info in info['videoUrlModels']] self._sort_formats(formats) return { 'id': video_id, 'title': info['videoName'], - 'thumbnail': info['bigHeadImage'], - 'creator': info['artistNames'], - 'duration': info['duration'], + 'thumbnail': info.get('bigHeadImage'), + 'creator': info.get('artistNames'), + 'duration': info.get('duration'), 'formats': formats, } |