Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vatanaksoytezer committed Jan 11, 2024
1 parent 5c7507f commit e182aab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gdown/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ def download(
res.headers["Content-Disposition"]
)
m = re.search(r"filename\*=UTF-8''(.*)", content_disposition)
filename_from_url = m.groups()[0]
if m is None and output is not None:
filename_from_url = osp.basename(output)
else:
filename_from_url = m.groups()[0]
filename_from_url = filename_from_url.replace(osp.sep, "_")
else:
filename_from_url = osp.basename(url)
Expand Down

0 comments on commit e182aab

Please sign in to comment.