From 44626bb68999897aeb1f7e6ad744699f32f11b41 Mon Sep 17 00:00:00 2001 From: jiemoon Date: Mon, 28 Mar 2016 10:15:56 +0800 Subject: [PATCH] fix: the download url is 403 --- src/you_get/extractors/qq.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/you_get/extractors/qq.py b/src/you_get/extractors/qq.py index 4d3c4f4b..d7e3c639 100644 --- a/src/you_get/extractors/qq.py +++ b/src/you_get/extractors/qq.py @@ -5,13 +5,14 @@ __all__ = ['qq_download'] from ..common import * def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False): - api = "http://h5vv.video.qq.com/getinfo?otype=json&vid=%s" % vid + api = "http://h5vv.video.qq.com/getinfo?platform=11001&otype=json&vid=%s" % vid content = get_html(api) output_json = json.loads(match1(content, r'QZOutputJson=(.*)')[:-1]) url = output_json['vl']['vi'][0]['ul']['ui'][0]['url'] fvkey = output_json['vl']['vi'][0]['fvkey'] - lnk = output_json['vl']['vi'][0]['lnk'] - url = '%s/%s.mp4?vkey=%s' % ( url, lnk, fvkey ) + fn = output_json['vl']['vi'][0]['fn'] + url = '%s/%s?vkey=%s' % ( url, fn, fvkey ) + print(url) _, ext, size = url_info(url, faker=True) print_info(site_info, title, ext, size)