From ee06e3a51647f55ceede9ef8d404b715240c0fec Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 11 Nov 2015 04:20:26 +0100 Subject: [PATCH] [embed] support embedded yinyuetai patterns --- src/you_get/extractors/embed.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/you_get/extractors/embed.py b/src/you_get/extractors/embed.py index 491917f4..10e1e3ca 100644 --- a/src/you_get/extractors/embed.py +++ b/src/you_get/extractors/embed.py @@ -6,6 +6,7 @@ from .letv import letvcloud_download_by_vu from .qq import qq_download_by_vid from .sina import sina_download_by_vid from .tudou import tudou_download_by_id +from .yinyuetai import yinyuetai_download_by_id from .youku import youku_download_by_vid """ @@ -30,6 +31,8 @@ refer to http://open.tudou.com/wiki/video/info """ tudou_api_patterns = [ ] +yinyuetai_embed_patterns = [ 'player\.yinyuetai\.com/video/swf/(\d+)' ] + def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwargs): content = get_content(url) found = False @@ -44,6 +47,11 @@ def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwa found = True 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: raise NotImplementedError(url)