Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
848 B
1
Indexable
Never
import os
import shutil
import asyncio
from telethon import TelegramClient
import names
import time
import socks

api_id = 8
api_hash = '7245de8e747a0d6fbe11f7cc14fcc0bb'
device = 'iPhone 12'
system = '16.0.1'
app = '8.7.4 (2636)'
proxy = "176.119.140.248:7951:ingp3021016:Jn2IDGUEaO"


tel = "+79213741708"
async def main():
    
    
    client = TelegramClient(tel, api_id, api_hash, device_model=device, system_version=system, app_version=app, proxy=(socks.HTTP, proxy.split(':')[0], int(proxy.split(':')[1]), True, proxy.split(':')[2], proxy.split(':')[3].split('\n')[0]))

    
    try:
       await client.start(phone=tel, force_sms=True, max_attempts=100)
       time.sleep(5)

       user = await client.get_me()
     
       print(user)
       await client.disconnect()
    except Exception as ex:
        print(ex)



asyncio.run(main())