Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send_file with list of links #4262

Open
3 tasks done
MAKMED1337 opened this issue Dec 2, 2023 · 1 comment
Open
3 tasks done

send_file with list of links #4262

MAKMED1337 opened this issue Dec 2, 2023 · 1 comment

Comments

@MAKMED1337
Copy link

Code that causes the issue

await bot.send_file(user_id, file=[image_url])

Expected behavior

I was expecting that this will send file normal as

await bot.send_file(user_id, file=image_url)

But it also doesn't work with multiple links

Actual behavior

Throws exception

Traceback

File "/usr/local/lib/python3.11/site-packages/telethon/client/uploads.py", line 389, in send_file
  result += await self._send_album(
            ^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/telethon/client/uploads.py", line 504, in _send_album
  result = await self(request)
           ^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/telethon/client/users.py", line 30, in __call__
  return await self._call(self._sender, request, ordered=ordered)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/telethon/client/users.py", line 87, in _call
  result = await future
           ^^^^^^^^^^^^
telethon.errors.rpcerrorlist.MediaInvalidError: Media invalid (caused by SendMultiMediaRequest)

Telethon version

1.33.0, 1.32.1

Python version

3.11.0

Operating system (including distribution name and version)

Ubuntu 22.04

Other details

No response

Checklist

  • The error is in the library's code, and not in my own.
  • I have searched for this issue before posting it and there isn't an open duplicate.
  • I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip and triggered the bug in the latest version.
@balthild
Copy link

I encountered same issue. However, I found that sometimes it works.

Doesn't work:

  • list of video url
  • list of telethon.tl.types.InputMediaPhotoExternal

Works:

  • list of image url
  • list of telethon.tl.types.InputMediaDocumentExternal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants