From 46f8bc18ea5b4c59c6844d8cab343176fea98e83 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sat, 23 Jan 2016 11:38:11 +0800 Subject: [PATCH] [qq] support for embedded video URLs e.g. http://v.qq.com/iframe/player.html?vid=q01536xb5rb&tiny=0&auto=0 --- src/you_get/extractors/qq.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/you_get/extractors/qq.py b/src/you_get/extractors/qq.py index b1d8eb0f..01d4311f 100644 --- a/src/you_get/extractors/qq.py +++ b/src/you_get/extractors/qq.py @@ -16,9 +16,14 @@ def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False): download_urls([url], title, ext, size, output_dir=output_dir, merge=merge) def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs): - content = get_html(url) - vid = match1(content, r'vid\s*:\s*"\s*([^"]+)"') - title = match1(content, r'title\s*:\s*"\s*([^"]+)"') + if 'iframe/player.html' in url: + vid = match1(url, r'\bvid=(\w+)') + # for embedded URLs; don't know what the title is + title = vid + else: + content = get_html(url) + vid = match1(content, r'vid\s*:\s*"\s*([^"]+)"') + title = match1(content, r'title\s*:\s*"\s*([^"]+)"') qq_download_by_vid(vid, title, output_dir, merge, info_only)