-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.py
43 lines (33 loc) · 931 Bytes
/
main.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
#!/usr/bin/env python
from pyrogram import Client
from modules.configuration import Configuration
from modules.sms import GetSMSCode
from time import sleep
cfg_obj = Configuration()
config = cfg_obj.load()
sms = GetSMSCode(config)
def phone_code_callback(mobile_number):
sleep(30)
code = sms.get_code(mobile_number)
return code
def main():
mobile_number = sms.get_mobile_number()
# Get current account balance before signup
print(sms.account_info)
try:
app = Client(
session_name=mobile_number,
phone_number=mobile_number,
phone_code=phone_code_callback,
first_name="John",
last_name="Doe"
)
with app:
print(app.get_me())
return mobile_number
except Exception as e:
print(e)
print(sms.blacklist(mobile_number))
return None
if __name__ == '__main__':
main()