-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgenereatorestring.py
More file actions
57 lines (49 loc) · 1.06 KB
/
Copy pathgenereatorestring.py
File metadata and controls
57 lines (49 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import os
from time import sleep
from pyrogram import Client
try:
os.remove("my.session")
except Exception:
pass
try:
os.remove("bot.session")
except Exception:
pass
try:
os.remove("session.session")
except Exception:
pass
def clear():
if os.name == "posix":
os.system("clear")
elif os.name == "nt":
os.system("cls")
else:
pass
def impostaapi():
clear()
while True:
api_id = input("Inserisci app_id: ")
if str(api_id).isdigit():
break
clear()
print("app_id non valida!")
sleep(2)
clear()
app_hash = input("Inserisci api_hash: ")
if app_hash:
creasess(api_id, app_hash)
def creasess(api_id, app_hash):
app = Client("session", int(api_id), app_hash)
try:
clear()
app.start()
except Exception:
clear()
input("app_id/api_hash/numero di telefono non validi")
impostaapi()
session = app.export_session_string()
print(f"String:\n\n{session}")
app.stop()
clear()
impostaapi()