mirror of
https://github.com/soimort/you-get.git
synced 2025-01-24 05:55:02 +03:00
[universal] better extraction of title and ext
This commit is contained in:
parent
ead0979ca1
commit
25aa2ac2e5
@ -112,10 +112,9 @@ def universal_download(url, output_dir='.', merge=True, info_only=False, **kwarg
|
||||
|
||||
else:
|
||||
# direct download
|
||||
filename = parse.unquote(url.split('/')[-1])
|
||||
title = '.'.join(filename.split('.')[:-1])
|
||||
ext = filename.split('.')[-1]
|
||||
_, _, size = url_info(url, faker=True)
|
||||
filename = parse.unquote(url.split('/')[-1]) or parse.unquote(url.split('/')[-2])
|
||||
title = '.'.join(filename.split('.')[:-1]) or filename
|
||||
_, ext, size = url_info(url, faker=True)
|
||||
print_info(site_info, title, ext, size)
|
||||
if not info_only:
|
||||
download_urls([url], title, ext, size,
|
||||
|
Loading…
Reference in New Issue
Block a user