mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Don't create download dirs for in-memory downloads
This commit is contained in:
parent
a2fe5b3e79
commit
4edaa21c19
1 changed files with 1 additions and 1 deletions
|
|
@ -726,7 +726,7 @@ class Client(Methods):
|
||||||
async def handle_download(self, packet):
|
async def handle_download(self, packet):
|
||||||
file_id, directory, file_name, in_memory, file_size, progress, progress_args = packet
|
file_id, directory, file_name, in_memory, file_size, progress, progress_args = packet
|
||||||
|
|
||||||
os.makedirs(directory, exist_ok=True)
|
os.makedirs(directory, exist_ok=True) if not in_memory else None
|
||||||
temp_file_path = os.path.abspath(re.sub("\\\\", "/", os.path.join(directory, file_name))) + ".temp"
|
temp_file_path = os.path.abspath(re.sub("\\\\", "/", os.path.join(directory, file_name))) + ".temp"
|
||||||
file = BytesIO() if in_memory else open(temp_file_path, "wb")
|
file = BytesIO() if in_memory else open(temp_file_path, "wb")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue