From b8d4b6b80c0300a0947a6f1cae5eaf9a0389cdba Mon Sep 17 00:00:00 2001 From: daiwei Date: Fri, 15 Jul 2016 23:31:17 +0800 Subject: [PATCH] more embed videos --- src/you_get/extractors/embed.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/you_get/extractors/embed.py b/src/you_get/extractors/embed.py index a177e663..b463313e 100644 --- a/src/you_get/extractors/embed.py +++ b/src/you_get/extractors/embed.py @@ -42,6 +42,14 @@ netease_embed_patterns = [ '(http://\w+\.163\.com/movie/[^\'"]+)' ] vimeo_embed_patters = [ 'player\.vimeo\.com/video/(\d+)' ] +qq_embed_patterns = [ 'v\.qq\.com/iframe/player.html\?vid=([0-9a-zA-Z]+)' ] + +""" +refer to http://help.lecloud.com/Wiki.jsp?page=PC4.0 +""" +letv_embed_patterns = [ 'http://yuntv.letv.com/player/vod/bcloud.js', + 'http://yuntv.letv.com/bcloud.js' ] + def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwargs): content = get_content(url, headers=fake_headers) @@ -68,6 +76,17 @@ def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwa found = True iqiyi_download_by_vid((vid[1], vid[0]), title=title, output_dir=output_dir, merge=merge, info_only=info_only) + vids = matchall(content, qq_embed_patterns) + for vid in vids: + found = True + qq_download_by_vid(vid, title=title, output_dir=output_dir, merge=merge, info_only=info_only) + + if len(matchall(content,letv_embed_patterns)): + found = True + uu=match1(content,r'uu[:+="]*([0-9a-zA-Z]+)') + vu=match1(content,r'vu[:+="]*([0-9a-zA-Z]+)') + letvcloud_download_by_vu(vu, uu, title=title, output_dir=output_dir, merge=merge, info_only=info_only) + urls = matchall(content, netease_embed_patterns) for url in urls: found = True