-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
64 lines (54 loc) · 1.73 KB
/
setup.py
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
58
59
60
61
62
63
64
#ask user for telegram details and guide them through it
print('Welcome to the Telegram Scraper setup wizard.')
print('This file will insert your login information to the Telegram Scraper scripts.')
print('Follow the README instructions to get your credentials.')
fin1 = open("detailsshell.py", "rt")
fout1 = open("details.py", "wt")
while True:
try:
a = input("Please enter your API ID:\n")
print(f'You entered "{a}"')
a1 = input('Is this correct? (y/n)')
if a1 == 'y':
print('Updating...')
new_text1 = a
break;
except:
continue
while True:
try:
h = input("Please enter your API Hash:\n")
print(f'You entered "{h}"')
a2 = input('Is this correct? (y/n)')
if a2 == 'y':
print('Updating...')
new_text2 = "'" + h + "'"
break;
except:
continue
while True:
try:
n = input("Please enter your phone number:\n")
print(f'You entered "{n}"')
a3 = input('Is this correct? (y/n)')
if a3 == 'y':
print('Updating...')
new_text3 = "'" + n + "'"
break;
except:
continue
checkWords = ("old_text1","old_text2","old_text3")
repWords = (new_text1,new_text2,new_text3)
for line in fin1:
for check, rep in zip(checkWords, repWords):
line = line.replace(check, rep)
fout1.write(line)
fin1.close()
fout1.close()
print('Setup is complete.')
launcher = input('Do you want to open the launcher? (y/n)')
if launcher == 'y':
print('Starting...')
exec(open("launcher.py").read())
else:
print('The launcher is now ready and can be started with the launcher.py file. You may now close the terminal.')