Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Failure to send verification code
#1
Hello
I want to perform the steps of login Pyrogram under Felsk
But Verification code will not be sent!
what is the problem?

app.py

from flask import Flask
from flask import render_template,request,redirect,url_for
from pyrogram import Client
app=Flask(__name__)



@app.route('/phone',methods=['GET','POST'])
def phone():
    if request.method=="POST":
        api_id=123
        api_hash="123"
        proxy=dict(hostname="127.0.0.1",port=9150)
        client = Client("bot_session",api_id,api_hash,proxy=proxy)
        client.connect()

        client.send_code(request.form.get("phone"))

        return redirect(url_for('code'))
    else:
        return render_template("phone.html")

@app.route('/code')
def code():
    return "ok"
phone.html

<html>
    <head>
        <title>phone</title>
    </head>
    <body>
        <form method="POST" action="{{ url_for('phone') }}">
            <label>phone</label>
            <input type="text" placeholder="phone" name="phone">
            <button type="submit">ok!</button>
        </form>
    </body>
</html>
[Image: 111884141-e0a65000-89d4-11eb-9758-bd9b6d2039f4.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failure in the Code to integrate via API Holded (accounting system) to Excel. maicolvela 1 811 May-10-2023, 01:20 PM
Last Post: buran
  Requests login failure test 10 9,557 Sep-13-2018, 08:48 AM
Last Post: test

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020