You accessed the same session from two different locations. make sure you disconnect cleanly from the one generated the session
I’m calling it from a cloud service. The key worked before I ran two codes using the same key at once and then now NONE of the keys I have work. I will generate new ones but is kinda weird to me
The ip shouldn't change for simultaneous connections of same session, that's always the reason. it's a security measure
Yeah but what about all the other sessions ? They shouldn’t magically break
Your cloud service should be the reason, if it changed recently
It changes every day and I did not create the string from the service.. just raising this as it seems like odd behaviour when it affect a all the strings created for the account
It's not much about the strings. your service is not cleanly disconnecting things and causes the termination because of parallel run under different ips
Now I am trying to generate a new session from within the cloud service and I get this error telethon.errors.rpcerrorlist.PhoneMigrateError: The phone number a user is trying to use for authorization is associated with DC 4 (caused by SendCodeReq uest)
the library should be handling that, but i haven't seen your code
import asyncio from telethon.sync import TelegramClient from telethon.sessions import StringSession async def create_string_session(api_id, api_hash): async with TelegramClient(StringSession(), api_id, api_hash) as client: new_string_session = client.session.save() return new_string_session
Yes works from local :)
Обсуждают сегодня