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
phone.html
I want to perform the steps of login Pyrogram under Felsk
But Verification code will not be sent!
what is the problem?
app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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" |
1 2 3 4 5 6 7 8 9 10 11 12 |
<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]](https://user-images.githubusercontent.com/52579456/111884141-e0a65000-89d4-11eb-9758-bd9b6d2039f4.png)