Mar-22-2021, 07:40 PM
(This post was last modified: Mar-22-2021, 07:40 PM by okdude2124.)
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
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>
