Skip to content

Commit

Permalink
[client] fixing bug in download_media
Browse files Browse the repository at this point in the history
  • Loading branch information
david-lev committed Nov 5, 2023
1 parent 9d86c80 commit f471b09
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pywa/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,10 +1075,8 @@ def download_media(
if path is None:
path = os.getcwd()
if filename is None:
filename = (
hashlib.sha256(url.encode()).hexdigest()
+ mimetypes.guess_extension(mimetype)
or ".bin"
filename = hashlib.sha256(url.encode()).hexdigest() + (
mimetypes.guess_extension(mimetype) or ".bin"
)
path = os.path.join(path, filename)
with open(path, "wb") as f:
Expand Down

0 comments on commit f471b09

Please sign in to comment.