diff --git a/src/you_get/extractors/qq.py b/src/you_get/extractors/qq.py index 8979b4aa..8ef18b08 100644 --- a/src/you_get/extractors/qq.py +++ b/src/you_get/extractors/qq.py @@ -34,7 +34,10 @@ def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False): part_info = get_content(key_api) key_json = json.loads(match1(part_info, r'QZOutputJson=(.*)')[:-1]) if key_json.get('key') is None: - log.w(key_json['msg']) + if part == 1: + log.wtf(key_json['msg']) + else: + log.w(key_json['msg']) break vkey = key_json['key'] url = '{}{}?vkey={}'.format(host, filename, vkey) @@ -135,7 +138,9 @@ def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs): else: content = get_content(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'v?id"*\s*:\s*"\s*([^"]+)"') #general fallback + vid = vid[0] if vid else match1(content, r'vid"*\s*:\s*"\s*([^"]+)"') #general fallback + if vid is None: + vid = match1(content, r'id"*\s*:\s*"(.+?)"') 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