[Python] Python libraries like kurigram(pyrogram fork) not send sms code

Discussão em 'Python' iniciado por Stack, Março 15, 2025.

  1. Stack

    Stack Membro Participativo

    Since 18 Feb 2023, Telegram no longer send verification code by SMS when trying to connect with 3rd-party libraries.

    Telegram gives on the official pair which is used in android telegram API_PUBLISHED_FLOOD

    pair:

    4:014b35b6184100b085b0d0572f9b5103


    I'm looking for a way to fix this story because I know there is a 100% solution.

    What did I do?

    I added a bunch of different parameters to init connection.

    For example, I will take pyrogram code, but telethon has the same results, only there inside the library I had to add params and uncomment lang_pack

    init_params = JsonObject(value=[
    JsonObjectValue(
    key="installer",
    value=JsonString(value="com.android.shell")
    ),
    JsonObjectValue(
    key="package_id",
    value=JsonString(value="org.telegram.messenger")
    ),
    JsonObjectValue(
    key="tz_offset",
    value=JsonNumber(value=-25200)
    ),
    JsonObjectValue(
    key="perf_cat",
    value=JsonNumber(value=params['PERF_CAT']) # for example 2
    )
    ])

    try:
    app = Client(number,
    phone_number=number,
    workdir="soft/sessions",
    api_id=params['APP_ID'], // next params for example 4
    api_hash=params['APP_HASH'], // "014b35b6184100b085b0d0572f9b5103"
    device_model=params['DEVICE'], // "Huaweinova Y90"
    system_version=params['SDK'], // "SDK 30"
    app_version="11.8.2 (57842)",
    lang_pack=params['LANG_PACK'], // "android"
    lang_code=params['LANG_CODE'], // "es"
    system_lang_code=params['SYSTEM_LANG_CODE'], // "es-la"
    proxy=proxy,
    client_platform=ClientPlatform.ANDROID,
    init_connection_params=init_params
    )

    await app.connect()
    sent = await app.send_code(
    phone_number=number,
    allow_app_hash=True,
    allow_flashcall=True,
    allow_firebase=True,
    current_number=True,
    allow_missed_call=True,
    )


    This did not produce any results.

    Then I went to look at telegram android source https://github.com/DrKLO/Telegram.

    Build in 2 modes, release and debug.

    Both applications write API_PUBLISHED_FLOOD in the logs.

    I got the feeling that Telegram does not document all the parts and something is missing in this puzzle.

    Continue reading...

Compartilhe esta Página