From 6087fc0b0a6e19ed15b4b66ecf7c0e3667bc8b8d Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 7 Mar 2013 22:56:28 +0100 Subject: [PATCH] QQ: support QQMusic (y.qq.com) --- src/you_get/downloader/qq.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/you_get/downloader/qq.py b/src/you_get/downloader/qq.py index da56ea12..c815a52f 100644 --- a/src/you_get/downloader/qq.py +++ b/src/you_get/downloader/qq.py @@ -17,7 +17,14 @@ def qq_download(url, output_dir = '.', merge = True, info_only = False): if re.match(r'http://v.qq.com/([^\?]+)\?vid', url): aid = r1(r'(.*)\.html', url) vid = r1(r'http://v.qq.com/[^\?]+\?vid=(\w+)', url) - url = aid + ".html?vid=" + vid + url = "%s/%s.html" % (aid, vid) + + if re.match(r'http://y.qq.com/([^\?]+)\?vid', url): + vid = r1(r'http://y.qq.com/[^\?]+\?vid=(\w+)', url) + url_1 = "http://v.qq.com/page/%s.html" % vid + url_2 = r1(r'url=([^"]*)', get_html(url_1)) + aid = r1(r'(.*)\.html', url_2) + url = "%s/%s.html" % (aid, vid) html = get_html(url)