[embed] support embedded yinyuetai patterns

This commit is contained in:
Mort Yao 2015-11-11 04:20:26 +01:00
parent 4d8e6e5c99
commit ee06e3a516

View File

@ -6,6 +6,7 @@ from .letv import letvcloud_download_by_vu
from .qq import qq_download_by_vid from .qq import qq_download_by_vid
from .sina import sina_download_by_vid from .sina import sina_download_by_vid
from .tudou import tudou_download_by_id from .tudou import tudou_download_by_id
from .yinyuetai import yinyuetai_download_by_id
from .youku import youku_download_by_vid from .youku import youku_download_by_vid
""" """
@ -30,6 +31,8 @@ refer to http://open.tudou.com/wiki/video/info
""" """
tudou_api_patterns = [ ] tudou_api_patterns = [ ]
yinyuetai_embed_patterns = [ 'player\.yinyuetai\.com/video/swf/(\d+)' ]
def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwargs): def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwargs):
content = get_content(url) content = get_content(url)
found = False found = False
@ -44,6 +47,11 @@ def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwa
found = True found = True
tudou_download_by_id(vid, title=title, output_dir=output_dir, merge=merge, info_only=info_only) tudou_download_by_id(vid, title=title, output_dir=output_dir, merge=merge, info_only=info_only)
vids = matchall(content, yinyuetai_embed_patterns)
for vid in vids:
found = True
yinyuetai_download_by_id(vid, title=title, output_dir=output_dir, merge=merge, info_only=info_only)
if not found: if not found:
raise NotImplementedError(url) raise NotImplementedError(url)