fixed qq proxy

This commit is contained in:
ivan 2017-03-08 00:41:44 +08:00
parent 6fcbc5ee98
commit dc1f78024b

View File

@ -199,7 +199,12 @@ class QQ(VideoExtractor):
key_api = 'http://vv.video.qq.com/getvkey?vid={vid}&appver={appver}&platform={platform}&otype=json&filename={filename}&format={format}&cKey={cKey}&guid={guid}&charge=1&encryptVer=5.4&lnk={vid}'.format( key_api = 'http://vv.video.qq.com/getvkey?vid={vid}&appver={appver}&platform={platform}&otype=json&filename={filename}&format={format}&cKey={cKey}&guid={guid}&charge=1&encryptVer=5.4&lnk={vid}'.format(
vid=vid, appver=appver, filename=self._getfilename(lnk, format, idx), vid=vid, appver=appver, filename=self._getfilename(lnk, format, idx),
format=format, cKey=cKey, guid=guid, platform=platform, lnk=lnk) format=format, cKey=cKey, guid=guid, platform=platform, lnk=lnk)
part_info = get_html(key_api) if 'extractor_proxy' in kwargs and kwargs['extractor_proxy']:
set_proxy(parse_host(kwargs['extractor_proxy']))
part_info = get_html(key_api)
unset_proxy()
else:
part_info = get_html(key_api)
key_json = json.loads(match1(part_info, r'QZOutputJson=(.*)')[:-1]) key_json = json.loads(match1(part_info, r'QZOutputJson=(.*)')[:-1])
return 'key' in key_json and key_json['key'] return 'key' in key_json and key_json['key']