2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

allow file objects be passed to file_name arg of client.download_media

This commit is contained in:
Eric Blundell 2018-03-20 08:33:14 -05:00
parent db80c72b08
commit 0694480a46

View File

@ -516,7 +516,7 @@ class Client:
# Make file_dir if it was specified
os.makedirs(file_dir, exist_ok=True)
if file_name is not None:
if isinstance(file_name, str) and file_name is not None:
os.makedirs(os.path.dirname(file_name), exist_ok=True)
if isinstance(media, types.MessageMediaDocument):