fix the error when parse ku6 url (such as

http://v.ku6.com/show/dBKZbnO51PWi7N2xRa3Bmw...html), case the sub-url
end with mp4?AccessKeyId=...&Expires=...&Signature=...
This commit is contained in:
XiaochenCui 2017-05-07 06:38:03 +08:00
parent b4705e44e5
commit 155e434607

View File

@ -14,7 +14,7 @@ def ku6_download_by_id(id, title = None, output_dir = '.', merge = True, info_on
title = title or t title = title or t
assert title assert title
urls = f.split(',') urls = f.split(',')
ext = re.sub(r'.*\.', '', urls[0]) ext = re.match(r'.*\.(\w+)\??[^\.]*', urls[0]).group(1)
assert ext in ('flv', 'mp4', 'f4v'), ext assert ext in ('flv', 'mp4', 'f4v'), ext
ext = {'f4v': 'flv'}.get(ext, ext) ext = {'f4v': 'flv'}.get(ext, ext)
size = 0 size = 0