mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Downloadable mixin uses directory creation parameter in bot methods
This commit is contained in:
parent
962a7edb52
commit
632c439411
1 changed files with 2 additions and 5 deletions
|
|
@ -49,7 +49,6 @@ class Downloadable:
|
|||
destination,
|
||||
destination_dir,
|
||||
destination_file,
|
||||
make_dirs
|
||||
)
|
||||
|
||||
return await self.bot.download_file(
|
||||
|
|
@ -58,9 +57,10 @@ class Downloadable:
|
|||
timeout=timeout,
|
||||
chunk_size=chunk_size,
|
||||
seek=seek,
|
||||
make_dirs=make_dirs
|
||||
)
|
||||
|
||||
async def _prepare_destination(self, dest, destination_dir, destination_file, make_dirs):
|
||||
async def _prepare_destination(self, dest, destination_dir, destination_file):
|
||||
file = await self.get_file()
|
||||
|
||||
if not(any((dest, destination_dir, destination_file))):
|
||||
|
|
@ -87,9 +87,6 @@ class Downloadable:
|
|||
else:
|
||||
raise TypeError("destination_file must be str, pathlib.Path or io.IOBase type")
|
||||
|
||||
if make_dirs and os.path.dirname(destination):
|
||||
os.makedirs(os.path.dirname(destination), exist_ok=True)
|
||||
|
||||
return file, destination
|
||||
|
||||
async def get_file(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue