This commit is contained in:
Mort Yao 2017-10-13 17:56:08 +02:00
parent 77542320f0
commit 31200781b2
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -27,7 +27,10 @@ def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False):
part_urls= []
total_size = 0
for part in range(1, seg_cnt+1):
filename = fn_pre + '.p' + str(part_format_id % 10000) + '.' + str(part) + '.mp4'
if seg_cnt == 1 and video_json['vl']['vi'][0]['vh'] <= 480:
filename = fn_pre + '.mp4'
else:
filename = fn_pre + '.p' + str(part_format_id % 10000) + '.' + str(part) + '.mp4'
key_api = "http://vv.video.qq.com/getkey?otype=json&platform=11&format={}&vid={}&filename={}&appver=3.2.19.333".format(part_format_id, vid, filename)
part_info = get_content(key_api)
key_json = json.loads(match1(part_info, r'QZOutputJson=(.*)')[:-1])