create_client.py 983 B

12345678910111213141516171819202122232425262728293031323334
  1. from telethon import TelegramClient
  2. import sqlite3
  3. import time
  4. db = sqlite3.connect('Account.db')
  5. cur = db.cursor()
  6. x = 1
  7. while(True):
  8. print("Очередь аккаунта № " + str(x))
  9. cur.execute(f"SELECT PHONE FROM Account WHERE ID = '{x}'")
  10. time.sleep(0.2)
  11. Phone = str(cur.fetchone()[0])
  12. print("Входим в аккаунт: " + Phone)
  13. cur.execute(f"SELECT PASS FROM Account WHERE ID = '{x}'")
  14. time.sleep(0.2)
  15. password = str(cur.fetchone()[0])
  16. print(password)
  17. cur.execute(f"SELECT API_ID FROM Account WHERE ID = '{x}'")
  18. time.sleep(0.2)
  19. api_id = str(cur.fetchone()[0])
  20. cur.execute(f"SELECT API_HASH FROM Account WHERE ID = '{x}'")
  21. time.sleep(0.2)
  22. api_hash = str(cur.fetchone()[0])
  23. session = str("anon" + str(x))
  24. client = TelegramClient(session, api_id, api_hash)
  25. client.start()
  26. x = x + 1
  27. time.sleep(1)
  28. if x == 32:
  29. print("Aккаунты активированы!")
  30. break