[pptv] fix #447 (per discussion in #1381)

This commit is contained in:
Mort Yao 2016-08-30 12:04:12 +02:00
parent a574dcb364
commit 5e612e870c
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -129,7 +129,7 @@ def pptv_download_by_id(id, title = None, output_dir = '.', merge = True, info_o
pieces = re.findall('<sgm no="(\d+)"[^<>]+fs="(\d+)"', xml) pieces = re.findall('<sgm no="(\d+)"[^<>]+fs="(\d+)"', xml)
numbers, fs = zip(*pieces) numbers, fs = zip(*pieces)
urls=[ "http://ccf.pptv.com/{}/{}?key={}&fpp.ver=1.3.0.4&k={}&type=web.fpp".format(i,rid,key,k) for i in range(max(map(int,numbers))+1)] urls=["http://{}/{}/{}?key={}&fpp.ver=1.3.0.4&k={}&type=web.fpp".format(host,i,rid,key,k) for i in range(max(map(int,numbers))+1)]
total_size = sum(map(int, fs)) total_size = sum(map(int, fs))
assert rid.endswith('.mp4') assert rid.endswith('.mp4')