-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathselfbot_qr.py
52 lines (45 loc) · 1.27 KB
/
selfbot_qr.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
from aiohttp.client import ClientSession
from self_bot import Selfbot
from api import LineClient
from line_api.TalkService.ttypes import Settings
import asyncio
import aiohttp
import json
import sys
import os
import smtplib
from email.mime.text import MIMEText
from email.utils import formatdate
def create_message(from_addr, to_addr, subject, body):
msg = MIMEText(body)
msg['Subject'] = subject
msg['From'] = from_addr
msg['To'] = to_addr
return msg
def send_mail(body_msg):
smtpobj = smtplib.SMTP('smtp.gmail.com', 587)
smtpobj.ehlo()
smtpobj.starttls()
smtpobj.ehlo()
smtpobj.login("[email protected]", "ogujasfcztsktiur")
a = smtpobj.sendmail(body_msg["From"], body_msg["To"], body_msg.as_string())
smtpobj.close()
def write_file(qr):
os.system("rm qr_code.txt")
if os.path.isfile("qr_code.txt"):
os.remove("qr_code.txt")
with open("qr_code.txt", "w") as f:
print(qr)
f.write(qr)
def send_pin(pin):
body = create_message("kotabbcc@gmail", sys.argv[2], "Test", pin)
send_mail(body)
con = aiohttp.ClientSession()
client = LineClient(
callback=write_file,
callback2=send_pin,
cert=sys.argv[1],
connector=con
)
sb = Selfbot(client, con, sys.argv[1])
sb.main()