mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
Merge branch 'yinyuetai-api' into develop
This commit is contained in:
commit
7bdf8af620
@ -4,15 +4,11 @@ __all__ = ['yinyuetai_download', 'yinyuetai_download_by_id']
|
|||||||
|
|
||||||
from ..common import *
|
from ..common import *
|
||||||
|
|
||||||
def yinyuetai_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
def yinyuetai_download_by_id(vid, title=None, output_dir='.', merge=True, info_only=False):
|
||||||
assert title
|
video_info = json.loads(get_html('http://www.yinyuetai.com/insite/get-video-info?json=true&videoId=%s' % vid))
|
||||||
html = get_html('http://www.yinyuetai.com/insite/get-video-info?flex=true&videoId=' + id)
|
url_models = video_info['videoInfo']['coreVideoInfo']['videoUrlModels']
|
||||||
|
url_models = sorted(url_models, key=lambda i: i['qualityLevel'])
|
||||||
for quality in ['he\w*', 'hd\w*', 'hc\w*', '\w+']:
|
url = url_models[-1]['videoUrl']
|
||||||
url = r1(r'(http://' + quality + '\.yinyuetai\.com/uploads/videos/common/\w+\.(?:flv|mp4)\?(?:sc=[a-f0-9]{16}|v=\d{12}))', html)
|
|
||||||
if url:
|
|
||||||
break
|
|
||||||
assert url
|
|
||||||
type = ext = r1(r'\.(flv|mp4)', url)
|
type = ext = r1(r'\.(flv|mp4)', url)
|
||||||
_, _, size = url_info(url)
|
_, _, size = url_info(url)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user