-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path__main__.py
58 lines (49 loc) · 1.63 KB
/
__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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import base64
import time
import subprocess
import time
import threading
from ipad_wechat.config import *
from ipad_wechat.expand import getsize, get_guid_id
from ipad_wechat.IPad_qrcode.Auth import Auth
from ipad_wechat.common import we_bot
from ipad_wechat.utils import getAuthorization,My_Redis
def main():
if TGBOT == 'true':
subprocess.Popen('python3 -m tg_bot', shell=True)
bot = we_bot()
if getsize(Filename) == 0:
guid = bot.get_guid()
else:
guid = get_guid_id(Filename)
# guid = WXRecovery(WXSerialization(guid))
bot.WXRelease(guid)
guid = bot.get_guid()
if OPEN_PROXY == 'true':
bot.WXSetProxy(guid)
qr_code_image, uuid = bot.WXGetLoginQrcode(guid)
filename = 'wxlogin.jpg'
imagedata = base64.b64decode(qr_code_image)
file = open(filename, "wb")
file.write(imagedata)
file.close()
Auth(port=QRCODE_PORT, email=(QRCODE_EMAIL[0], QRCODE_EMAIL[1]))
while True:
time.sleep(4)
i = My_Redis(host=Redis_ip,port=Redis_port,password=Redis_pass)
i.Redis_set('login','true')
wxid, wxnewpass = bot.WXCheckLoginQrcode(guid, uuid)
if wxid:
bot.WXSecLoginManual(guid, wxid, wxnewpass)
bot.addserver(guid, CALL_BACK_IP)
bot.Heartbeat(guid)
def createTimer():
t = threading.Timer(Heartbeat_cycle, repeat)
t.start()
def repeat():
bot.TO_get_token(getAuthorization())
bot.Heartbeat(guid)
createTimer()
createTimer()
if __name__ == "__main__":
main()