[universal] strip query string for direct download

This commit is contained in:
Mort Yao 2018-12-26 16:48:32 +01:00
parent 672cc4b1f9
commit 1df62c39ff
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -137,7 +137,8 @@ def universal_download(url, output_dir='.', merge=True, info_only=False, **kwarg
else:
# direct download
filename = parse.unquote(url.split('/')[-1]) or parse.unquote(url.split('/')[-2])
url_trunk = url.split('?')[0] # strip query string
filename = parse.unquote(url_trunk.split('/')[-1]) or parse.unquote(url_trunk.split('/')[-2])
title = '.'.join(filename.split('.')[:-1]) or filename
_, ext, size = url_info(url, faker=True)
print_info(site_info, title, ext, size)