tg-archive icon indicating copy to clipboard operation
tg-archive copied to clipboard

Fix telethon issue #4051

Open tigra323 opened this issue 1 year ago • 5 comments

Fixes error that caused logout from all devices

tigra323 avatar Nov 10 '24 08:11 tigra323

Hi @tigra323. Could you please explain how this works?

knadh avatar Feb 16 '25 09:02 knadh

If you do not set these parameters, then after the program logs into your account, Telegram will log out from all devices

tigra323 avatar Feb 16 '25 09:02 tigra323

Was checking the docs: https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.telegrambaseclient.TelegramBaseClient

The lib automatically sets these params. Doesn't look like it's necessary to hardcode values.

device_model ([str](https://docs.python.org/3/library/stdtypes.html#str), optional):

    “Device model” to be sent when creating the initial connection. Defaults to ‘PC (n)bit’ derived from platform.uname().machine, or its direct value if unknown.
system_version ([str](https://docs.python.org/3/library/stdtypes.html#str), optional):

    “System version” to be sent when creating the initial connection. Defaults to platform.uname().release stripped of everything ahead of -.
app_version ([str](https://docs.python.org/3/library/stdtypes.html#str), optional):

    “App version” to be sent when creating the initial connection. Defaults to telethon.version.__version__.
lang_code ([str](https://docs.python.org/3/library/stdtypes.html#str), optional):

    “Language code” to be sent when creating the initial connection. Defaults to 'en'.

knadh avatar Feb 16 '25 10:02 knadh

If you do not set these parameters, then after the program logs into your account, Telegram will log out from all devices

Was that happening to you?

I just logged into my account with tg-archive and none of my devices were logged out.

pdwalker avatar Mar 19 '25 10:03 pdwalker

maybe it's because of the old version of Telethon that was required before or something else. But when I used Telethon before I was constantly getting out of all devices, adding these parameters helped me, but it’s strange that even after installing tg-archive, which updated Telethon to version 1.29.3 (required then) when I used tg-archive I got out of all devices again, but after adding these parameters I no longer got out of devices

tigra323 avatar Mar 19 '25 11:03 tigra323