-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdesktopwin.py
40 lines (34 loc) · 1.39 KB
/
desktopwin.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
from thrift.protocol import TCompactProtocol
from thrift.transport import THttpClient
from ttypes import LoginRequest
import json, requests, LineService
nama = 'DesktopWin\nCREATOR http://line.me/ti/p/~adiputra.95'
Headers = {
'User-Agent': "Line/8.3.2",
'X-Line-Application': "DESKTOPWIN\t8.3.2\tPRANKBOTS\t10.0.0",
"x-lal": "ja-US_US",
}
def qrLogin():
Headers.update({'x-lpqs' : '/api/v4/TalkService.do'})
transport = THttpClient.THttpClient('https://gd2.line.naver.jp/api/v4/TalkService.do')
transport.setCustomHeaders(Headers)
protocol = TCompactProtocol.TCompactProtocol(transport)
client = LineService.Client(protocol)
qr = client.getAuthQrcode(keepLoggedIn=1, systemName=nama)
link = "line://au/q/" + qr.verifier
print(link)
Headers.update({"x-lpqs" : '/api/v4/TalkService.do', 'X-Line-Access': qr.verifier})
json.loads(requests.session().get('https://gd2.line.naver.jp/Q', headers=Headers).text)
Headers.update({'x-lpqs' : '/api/v4p/rs'})
transport = THttpClient.THttpClient('https://gd2.line.naver.jp/api/v4p/rs')
transport.setCustomHeaders(Headers)
protocol = TCompactProtocol.TCompactProtocol(transport)
client = LineService.Client(protocol)
req = LoginRequest()
req.type = 1
req.verifier = qr.verifier
req.e2eeVersion = 1
res = client.loginZ(req)
print('\n')
print(res.authToken)
qrLogin()