Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

error when tring to use client.send_file for multiple photos

Open ram-sh opened this issue 4 years ago • 6 comments

Hello,

Using Python 3.7.5 and Telethon 1.11.3.

following the example from Telethon documentation

# Albums
await client.send_file(chat, [
    '/my/photos/holiday1.jpg',
    '/my/photos/holiday2.jpg',
    '/my/drawings/portrait.png'
])

when trying to send more than one photo using client.send_file i get "Media invalid (caused by SendMultiMediaRequest)" error.

when sending a single photo there is no error: await client.send_file(contact, 'http://s3.amazonaws.com/tn1.app/0.png')

the error occurs when trying to send more than one photo: await client.send_file(contact, ['http://s3.amazonaws.com/tn1.app/0.png', 'http://s3.amazonaws.com/tn1.app/2.png'])

thanks much in advance! RS

ram-sh avatar Mar 18 '20 06:03 ram-sh

Telegram doesn't support sending albums from URLs.

Lonami avatar Mar 18 '20 08:03 Lonami

thank you.

ram-sh avatar Mar 19 '20 14:03 ram-sh

Telegram doesn't support sending albums from URLs.

@Lonami I know that Bot API supports it, are you sure that MTProto doesn't support it?

AlirezaTheH avatar Aug 03 '20 11:08 AlirezaTheH

I have tried it and it did not work back when I tried. Bot API may be downloading and re-uploading behind the scenes which Telethon won't do.

Lonami avatar Aug 03 '20 12:08 Lonami

Seems that this problem occur again:

when sending a single photo there is no error: await client.send_file(contact, 'http://s3.amazonaws.com/tn1.app/0.png')

the error occurs when trying to send more than one photo: await client.send_file(contact, ['http://s3.amazonaws.com/tn1.app/0.png', 'http://s3.amazonaws.com/tn1.app/2.png'])

But the error message sent to me is "Media invalid (caused by UploadMediaRequest)" instead of "Media invalid (caused by SendMultiMediaRequest)".

Could anyone please check what's goion wrong? Thanks so much.

ghost avatar Nov 23 '21 18:11 ghost

I queried history, bugs may be here, I am not familiar with Python, can I fix this function as soon as possible?

https://github.com/LonamiWebs/Telethon/commit/72fc8f680817ea067b85c06c2d9223b219fd8f06

mzzsfy avatar Mar 03 '22 10:03 mzzsfy

Closing. Please ping back if the issue still occurs in the current git version.

Lonami avatar Apr 06 '23 12:04 Lonami