Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 1456

Need help with flask or something like that

by 01001911 - 24 April, 2022 - 08:19 PM
This post is by a banned member (01001911) - Unhide
01001911  
Supreme
210
Posts
22
Threads
5 Years of service
#1
Hi guys. I have a Python code that I use to get the telegram login code through the session. I'm wanting it to work in the browser, maybe Flask or something like that. Who can help me?
 
Code:
 
try:
 import os, sys, random
 from time import sleep
 from telethon import TelegramClient, sync
 from telethon.errors import SessionPasswordNeededError, FloodWaitError
 from telethon.tl.functions.messages import  GetHistoryRequest
 from flask import Flask
except:
 os.system("pip install random")
 os.system("pip install telethon")
 import os, sys, random
 from time import sleep
 from telethon import TelegramClient, sync
 from telethon.errors import SessionPasswordNeededError, FloodWaitError
 from telethon.tl.functions.messages import GetHistoryRequest
print("Get Login Code telegram")
while True:
   
           
        phone = input("Input Phone Number:")
        if phone == 'xx':
            os.system('clear')
            break
        else:
            api_id = 2015084
            api_hash = '24e8f34925604e25a9b8d695b21cf333'
            client = TelegramClient("session/"+phone,api_id,api_hash)
            client.connect()
            if not client.is_user_authorized():
                print (F"Session Error!" + phone)
                #client.log_out()
                client.disconnect()
                continue
            else:
                for message in client.get_messages(777000, limit=1):
                    msg = message.message
                    you_code = msg.split()[2].rstrip('.')
                    print ("Code =>> "+you_code)
                    client.disconnect()    
 
This post is by a banned member (TimeChangeEverything) - Unhide
39.948
Posts
13.047
Threads
5 Years of service
#2
I will look into this
[Image: 81QoXii.gif]
[Image: PUm4fxA.gif]

 
                                                      
Above Services are Paid Advertisement
This post is by a banned member (01001911) - Unhide
01001911  
Supreme
210
Posts
22
Threads
5 Years of service
#3
(24 April, 2022 - 08:23 PM)TimeChangeEverything Wrote: Show More
I will look into this

Pepeclap
 

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)