mirror of
https://github.com/leoncvlt/loconotion.git
synced 2024-08-30 18:12:12 +00:00
Clean up encoded query params from file extension
This commit is contained in:
parent
c1329e050c
commit
67bdfe24c4
@ -183,6 +183,8 @@ class Parser:
|
|||||||
content_type = response.headers.get("content-type")
|
content_type = response.headers.get("content-type")
|
||||||
if content_type:
|
if content_type:
|
||||||
file_extension = mimetypes.guess_extension(content_type)
|
file_extension = mimetypes.guess_extension(content_type)
|
||||||
|
elif '%3f' in file_extension.lower():
|
||||||
|
file_extension = re.split("%3f", file_extension, flags=re.IGNORECASE)[0]
|
||||||
destination = destination.with_suffix(file_extension)
|
destination = destination.with_suffix(file_extension)
|
||||||
|
|
||||||
Path(destination).parent.mkdir(parents=True, exist_ok=True)
|
Path(destination).parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user