opentele icon indicating copy to clipboard operation
opentele copied to clipboard

Cannot receive code with send_code_request.

Open mitntkanas opened this issue 3 years ago • 7 comments

It seems that they have Fix or have realized so when using the Send code request from the OpenTele, it does not receive SMS anymore, if the emulator or SMS is still received normally.

mitntkanas avatar Feb 13 '22 10:02 mitntkanas

Did you mean the function send_code_request of Telethon? If that's the case, you should open an issue on Telethon github, because it's not a part of Opentele.

Most likely Telegram changed their API workflow, I will check it when I have the time.

In the mean time, you could use QRLoginToNewClient to log in using an existing session.

thedemons avatar Feb 14 '22 23:02 thedemons

Did you mean the function send_code_request of Telethon? If that's the case, you should open an issue on Telethon github, because it's not a part of Opentele.

Most likely Telegram changed their API workflow, I will check it when I have the time.

In the mean time, you could use QRLoginToNewClient to log in using an existing session.

I asked telethon but they said it is Telegram who decides whether to send SMS, and I think maybe Telegram has changed the anti-account registration mechanism to restrict SMS, maybe it is related to the API, or device information.

mitntkanas avatar Feb 17 '22 17:02 mitntkanas

Did you mean the function send_code_request of Telethon? If that's the case, you should open an issue on Telethon github, because it's not a part of Opentele.

Most likely Telegram changed their API workflow, I will check it when I have the time.

In the mean time, you could use QRLoginToNewClient to log in using an existing session.

I asked telethon but they said it is Telegram who decides whether to send SMS, and I think maybe Telegram has changed the anti-account registration mechanism to restrict SMS, maybe it is related to the API, or device information.

Can you post your code here? I've checked and it worked fine for me.

thedemons avatar Feb 17 '22 21:02 thedemons

Did you mean the function send_code_request of Telethon? If that's the case, you should open an issue on Telethon github, because it's not a part of Opentele. Most likely Telegram changed their API workflow, I will check it when I have the time. In the mean time, you could use QRLoginToNewClient to log in using an existing session.

I asked telethon but they said it is Telegram who decides whether to send SMS, and I think maybe Telegram has changed the anti-account registration mechanism to restrict SMS, maybe it is related to the API, or device information.

Can you post your code here? I've checked and it worked fine for me. In my opinion Telegram has changed the device identification mechanism with new registered users.

 api = API.TelegramAndroid.Generate(unique_id=phone)
  try:    
    client = TelegramClient(phone, api=api, proxy=dict(proxy_type=socks.HTTP,
                            addr=configs.__HOST_IP_PROXY__, port=int(configs.USE_PORT)))
    
    client.connect()
    if not client.is_user_authorized():
      client.send_code_request(phone)
      otp = getOTPCodeByPhone()     
      client.sign_up(code=otp, first_name=name.strip(), phone=phone)
  except:
    client.disconnect()

mitntkanas avatar Feb 20 '22 06:02 mitntkanas

I have the same problem when using a telethon. In most cases, deleting the StringSession (or .session file) helps. But if there were too many requests, telegram stops sending code.

G-shaft avatar Mar 05 '22 00:03 G-shaft

Telegram change their API, I'll reverse the android app to see what it use to register and update a workaround for this soon.

thedemons avatar Mar 06 '22 11:03 thedemons

Telegram change their API, I'll reverse the android app to see what it use to register and update a workaround for this soon.

Any updates?

tomyumm-ge avatar Jun 22 '22 15:06 tomyumm-ge