You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from qrcode import QRCode
from base64 import urlsafe_b64encode as base64url
def gen_qr(token: str):
qr.clear()
qr.add_data(token)
qr.print_ascii()
def display_url_as_qr(url):
os.system("cls")
send_info_log("Generated new QR Code...")
gen_qr(url)
...
qr_login = await client.qr_login()
r = False
while not r:
display_url_as_qr(qr_login.url)
try:
r = await qr_login.wait(10)
except telethon.errors.rpcerrorlist.SessionPasswordNeededError:
await client.sign_in(password="")
r = True
except:
await qr_login.recreate()
me = await client.get_me()
I just recently used qr_login and noticed that it doesn't provide a way to enter a 2FA password.
So I had to come up with this solution:
Can you add this feature? It would be nice if we can pass the
password
argument toqr_login.wait(password=pw)
orclient.qr_login(password=pw)
The text was updated successfully, but these errors were encountered: