mirror of
https://github.com/soimort/you-get.git
synced 2025-03-14 20:04:00 +03:00
fix #106
This commit is contained in:
parent
106c85e2e5
commit
0967d731af
@ -133,11 +133,14 @@ def url_info(url, faker = False):
|
|||||||
ext = mapping[type]
|
ext = mapping[type]
|
||||||
else:
|
else:
|
||||||
type = None
|
type = None
|
||||||
|
if headers['content-disposition']:
|
||||||
filename = parse.unquote(r1(r'filename="?(.+)"?', headers['content-disposition']))
|
filename = parse.unquote(r1(r'filename="?(.+)"?', headers['content-disposition']))
|
||||||
if len(filename.split('.')) > 1:
|
if len(filename.split('.')) > 1:
|
||||||
ext = filename.split('.')[-1]
|
ext = filename.split('.')[-1]
|
||||||
else:
|
else:
|
||||||
ext = None
|
ext = None
|
||||||
|
else:
|
||||||
|
ext = None
|
||||||
|
|
||||||
if headers['transfer-encoding'] != 'chunked':
|
if headers['transfer-encoding'] != 'chunked':
|
||||||
size = int(headers['content-length'])
|
size = int(headers['content-length'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user