mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-26 16:30:44 +03:00
Accept InputFile/InputFileBig on .upload_file for 2c437c51
Now an input file thumbnail can also be specified, instead needing to reupload the file every time.
This commit is contained in:
parent
32505b905f
commit
4fba27dee9
|
@ -624,6 +624,9 @@ class TelegramBareClient:
|
||||||
part_size_kb = get_appropriated_part_size(file_size)
|
part_size_kb = get_appropriated_part_size(file_size)
|
||||||
file_name = os.path.basename(file_path)
|
file_name = os.path.basename(file_path)
|
||||||
"""
|
"""
|
||||||
|
if isinstance(file, (InputFile, InputFileBig)):
|
||||||
|
return file # Already uploaded
|
||||||
|
|
||||||
if isinstance(file, str):
|
if isinstance(file, str):
|
||||||
file_size = os.path.getsize(file)
|
file_size = os.path.getsize(file)
|
||||||
elif isinstance(file, bytes):
|
elif isinstance(file, bytes):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user