· 4 years ago · Feb 05, 2021, 12:42 PM
1create_client.py
2from telethon import TelegramClient
3import sqlite3
4import time
5from create import Phone,x,password,api_id,api_hash
6
7
8print("Очередь аккаунта № " + str(create.x))
9cur.execute(f"SELECT PHONE FROM Account WHERE ID = '{create.x}'")
10time.sleep(0.2)
11create.Phone = str(cur.fetchone()[0])
12print("Входим в аккаунт: " + create.Phone)
13cur.execute(f"SELECT PASS FROM Account WHERE ID = '{create.x}'")
14time.sleep(0.2)
15create.password = str(cur.fetchone()[0])
16print(create.password)
17cur.execute(f"SELECT API_ID FROM Account WHERE ID = '{create.x}'")
18time.sleep(0.2)
19create.api_id = str(cur.fetchone()[0])
20cur.execute(f"SELECT API_HASH FROM Account WHERE ID = '{create.x}'")
21time.sleep(0.2)
22create.api_hash = str(cur.fetchone()[0])
23session = str("anong" + str(x))
24client = TelegramClient(create.session, create.api_id, create.api_hash)
25client.start()
26time.sleep(1)
27 create.py
28import sqlite3
29import subprocess
30import sys
31from colorama import init, Fore, Back, Style
32x = 2
33init()
34Litecoin = input('Litecoin: ')
35while(True):
36 if x == 0:
37 break
38 x = x - 1
39 db = sqlite3.connect('Account.db')
40 cur = db.cursor()
41 # Создаем таблицу
42 cur.execute("""CREATE TABLE IF NOT EXISTS Account (
43 ID INTEGER PRIMARY KEY,
44 PHONE TEXT,
45 PASS TEXT,
46 API_ID TEXT,
47 API_HASH TEXT,
48 ACTIVITY TEXT,
49 LITECOIN TEXT
50 )""")
51
52 db.commit()
53
54 Phone = input('Phone: ')
55 password = input('Password: ')
56 Api_id = input('Api_ID: ')
57 Api_hash = input('api_hash: ')
58 Activity = "ON"
59
60 cur.execute(f"SELECT PHONE FROM Account WHERE PHONE = '{Phone}'")
61 if cur.fetchone() is None:
62 cur.execute("""INSERT INTO Account(PHONE, PASS, API_ID, API_HASH, ACTIVITY, LITECOIN) VALUES (?,?,?,?,?,?);""", (Phone, password, Api_id, Api_hash, Activity, Litecoin))
63 db.commit()
64 print("Зарегистрированно!")
65 for value in cur.execute("SELECT * FROM Account"):
66 print(value)
67 b = True
68 while(b):
69 process = subprocess.Popen([sys.executable, "create_client1.py"])
70 process.wait()
71 b = False