From bd2179ed7689916d6c1ae67d8ea08afc35224d20 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sat, 23 Jan 2016 11:47:08 +0800 Subject: [PATCH] [qq] fix title for some videos e.g. http://v.qq.com/cover/p/ps6mnfqyrfo7es3.html?vid=q0181hpdvo5 hope this won't break others, or we should try to recognize the URL pattern (maybe apply to only URLs with "/cover/")? --- src/you_get/extractors/qq.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/you_get/extractors/qq.py b/src/you_get/extractors/qq.py index b1d8eb0f..eb188f98 100644 --- a/src/you_get/extractors/qq.py +++ b/src/you_get/extractors/qq.py @@ -19,6 +19,9 @@ 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*([^"]+)"') + # try to get the right title for URLs like this: + # http://v.qq.com/cover/p/ps6mnfqyrfo7es3.html?vid=q0181hpdvo5 + title = matchall(content, [r'title\s*:\s*"\s*([^"]+)"'])[-1] qq_download_by_vid(vid, title, output_dir, merge, info_only)