aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-07-09 00:48:23 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-07-09 00:48:23 +0800
commit68923e52a36c7eff5dabe5d969f9ff1eac0b5269 (patch)
treeba632f09add7b3d2e24a621a5c88b99a36949463
parent9281f6d25338c179e7bc2f48352da3311102158e (diff)
parent37c1e4025c6df834e93a64c1c13eebac23e90942 (diff)
Merge branch 'yinyuetai' of https://github.com/ping/youtube-dl into ping-yinyuetai
-rw-r--r--youtube_dl/extractor/__init__.py1
-rw-r--r--youtube_dl/extractor/yinyuetai.py47
2 files changed, 48 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index f7c1f07a4..a0e3b333d 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -734,6 +734,7 @@ from .yandexmusic import (
YandexMusicPlaylistIE,
)
from .yesjapan import YesJapanIE
+from .yinyuetai import YinYueTaiIE
from .ynet import YnetIE
from .youjizz import YouJizzIE
from .youku import YoukuIE
diff --git a/youtube_dl/extractor/yinyuetai.py b/youtube_dl/extractor/yinyuetai.py
new file mode 100644
index 000000000..661c34602
--- /dev/null
+++ b/youtube_dl/extractor/yinyuetai.py
@@ -0,0 +1,47 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class YinYueTaiIE(InfoExtractor):
+ IE_NAME = 'yinyuetai:video'
+ _VALID_URL = r'https?://v\.yinyuetai\.com/video(/h5)?/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'http://v.yinyuetai.com/video/2322376',
+ 'md5': '6e3abe28d38e3a54b591f9f040595ce0',
+ 'info_dict': {
+ 'id': '2322376',
+ 'ext': 'mp4',
+ 'title': '少女时代_PARTY_Music Video Teaser',
+ 'creator': '少女时代',
+ },
+ }
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+
+ info = self._download_json(
+ 'http://ext.yinyuetai.com/main/get-h-mv-info?json=true&videoId=%s' % video_id, video_id,
+ 'Downloading mv info')['videoInfo']['coreVideoInfo']
+
+ if info['error']:
+ raise ExtractorError(info['errorMsg'], expected=True)
+
+ formats = [
+ {'url': format_info['videoUrl'], 'format_id': format_info['qualityLevel'],
+ 'format': format_info['qualityLevelName'], 'filesize': format_info['fileSize'],
+ 'ext': 'mp4', 'preference': format_info['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'],
+ 'formats': formats,
+ }