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

Self destructing photo, dont download. #4391

Open
3 tasks done
vanylav opened this issue Jun 16, 2024 · 6 comments
Open
3 tasks done

Self destructing photo, dont download. #4391

vanylav opened this issue Jun 16, 2024 · 6 comments

Comments

@vanylav
Copy link

vanylav commented Jun 16, 2024

Code that causes the issue

...
if message.media:
                path = ""
                try:
                    print(message)
                    save = await self.client.get_entity(-4222209239)
                    path = await self.client.download_media(message)
                    await self.client.send_file(save, path, caption=f"Save: {user.first_name}")
                    os.remove(path)
                except Exception as er:
                    await self.client.send_message('me', 'Error: '+str(er))
                    try:
                        await self.client.send_file('me', path, caption=f"Save: {user.first_name}")
                        os.remove(path)
                    except:
                        pass
...

Expected behavior

A self-destructing photo arrives (to be viewed once), the code downloads the image and sends it to another channel.

Actual behavior

A self-destructing photo arrives (to be viewed once), the code gives an error that the media type is not supported.

Traceback

Message(id=1541508, peer_id=PeerUser(user_id=6758782663), date=datetime.datetime(2024, 6, 16, 8, 34, 40, tzinfo=datetime.timezone.utc), message='', out=False, mentioned=False, media_unread=True, silent=False, post=False, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=MessageMediaUnsupported(), reply_markup=None, entities=[], views=None, forwards=None, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None)

Telethon version

1.27.0

Python version

3.10.12

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.
@vanylav
Copy link
Author

vanylav commented Jun 16, 2024

Forgot to add, the code works fine for self-destructing photos with a 3s, 10s, 30s delay.

@Lonami
Copy link
Member

Lonami commented Jun 16, 2024

Telethon version
1.27.0

Only the latest version is supported.

@Lonami Lonami closed this as completed Jun 16, 2024
@vanylav
Copy link
Author

vanylav commented Jun 16, 2024

I also tried it on 1.36.0.
UPD:
Should I create a new issue?

@Lonami Lonami reopened this Jun 16, 2024
@Lonami
Copy link
Member

Lonami commented Jun 16, 2024

Stil unlikely there's anything the library can do for media unsupported until an update.

@drizzo0
Copy link

drizzo0 commented Jun 26, 2024

Use v2

@Lonami
Copy link
Member

Lonami commented Jun 27, 2024

v2 is not ready for use (and the library version doesn't matter, only the layer used).

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

3 participants