mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
allow file objects be passed to file_name arg of client.download_media
This commit is contained in:
parent
db80c72b08
commit
0694480a46
@ -516,7 +516,7 @@ class Client:
|
|||||||
# Make file_dir if it was specified
|
# Make file_dir if it was specified
|
||||||
os.makedirs(file_dir, exist_ok=True)
|
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)
|
os.makedirs(os.path.dirname(file_name), exist_ok=True)
|
||||||
|
|
||||||
if isinstance(media, types.MessageMediaDocument):
|
if isinstance(media, types.MessageMediaDocument):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user