mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-10 18:59:33 +00: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:
@@ -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):
|
||||||
|
Reference in New Issue
Block a user