-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogin.py
More file actions
36 lines (24 loc) · 932 Bytes
/
login.py
File metadata and controls
36 lines (24 loc) · 932 Bytes
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
import requests
data = { "type": "init", "appid" : "APPIDHERE" }
init_ret = requests.post("https://intertwined.solutions/api/", data=data)
json = init_ret.json()
if json['success'] == False:
print("Unable to initiate.")
exit()
sid = json['sessionid']
print("Session ID: ", sid)
username = input('Username: ')
password = input('Password: ')
data = { "type": "login", "sid" : sid, "user" : username, "pass" : password }
login_ret = requests.post("https://intertwined.solutions/api/", data=data)
json = login_ret.json()
if json['success'] == False:
data = { "type": "close", "sid" : sid }
close_ret = requests.post("https://intertwined.solutions/api/", data=data)
print("Login Error: ", json['error'])
exit()
print("Successfully logged in!")
print("User data: ", json['data'])
data = { "type": "close", "sid" : sid }
close_ret = requests.post("https://intertwined.solutions/api/", data=data)
exit()