From b5ea034a5e40e37710fa643ce61f15d9f0c1c9ee Mon Sep 17 00:00:00 2001
From: ivan
Date: Tue, 14 Mar 2017 14:32:57 +0800
Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/you_get/extractors/qq.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/you_get/extractors/qq.py b/src/you_get/extractors/qq.py
index 7bb99d9c..6380e423 100644
--- a/src/you_get/extractors/qq.py
+++ b/src/you_get/extractors/qq.py
@@ -170,7 +170,8 @@ class QQ(VideoExtractor):
info = get_html(info_api)
video_json = json.loads(match1(info, r'QZOutputJson=(.*)')[:-1])
if 'vl' not in video_json or 'vi' not in video_json['vl']:
- sys.stderr.writelines('Extract failed!!\n'+info+'\n')
+ # sys.stderr.writelines('Extract failed!!\n'+info+'\n')
+ print('Extract failed!!', info, file=sys.stderr)
return
vi0 = video_json['vl']['vi'][0]
lnk = vi0['lnk']
@@ -262,21 +263,21 @@ def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
if 'kuaibao.qq.com' in url or re.match(r'http://daxue.qq.com/content/content/id/\d+', url):
content = get_html(url)
vid = match1(content, r'vid\s*=\s*"\s*([^"]+)"')
- title = match1(content, r'title">([^"]+)
')
- title = title.strip() if title else vid
+ # title = match1(content, r'title">([^"]+)')
+ # title = title.strip() if title else vid
elif 'iframe/player.html' in url:
vid = match1(url, r'\bvid=(\w+)')
# for embedded URLs; don't know what the title is
- title = vid
+ # title = vid
else:
content = get_html(url)
vid = parse_qs(urlparse(url).query).get(
'vid') # for links specified vid like http://v.qq.com/cover/p/ps6mnfqyrfo7es3.html?vid=q0181hpdvo5
vid = vid[0] if vid else match1(content, r'vid"*\s*:\s*"\s*([^"]+)"') # general fallback
- title = match1(content, r'' % vid)
- title = match1(content, r'title">([^"]+)') if not title else title
- title = match1(content, r'"title":"([^"]+)"') if not title else title
- title = vid if not title else title # general fallback
+ # title = match1(content, r'' % vid)
+ # title = match1(content, r'title">([^"]+)') if not title else title
+ # title = match1(content, r'"title":"([^"]+)"') if not title else title
+ # title = vid if not title else title # general fallback
site.download_by_vid(vid=vid, output_dir=output_dir, merge=merge, info_only=info_only, **kwargs)