-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
57 lines (48 loc) · 1.97 KB
/
main.py
File metadata and controls
57 lines (48 loc) · 1.97 KB
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
from authentication.oauth import finder
from authentication.setup import AddAuthenticator
from authentication.deviceId import getDeviceId
from authentication.guard import SteamGuard
from authentication.login import Login
import json
def guide(self):
print(
"""
All Functions:
Show guide - requestGuide();\n
Get access token - requestOauth(*path);\n
Generate device id - requestDeviceId(steamid);\n
Add authenticator - requestSetup(steamid, access_token, device id);\n
List logged secret keys - requestSecrets();\n
Generate two-factor authentication code - requestAuthCode(time, secret_key);\n
Generate trade offer confirmation key - requestConfKey(time, secret_key, tag_name);\n
Send login request - requestLogin(username, password, secret_key);\n
"""
)
def oauth(*p):
if len(p) < 1:
finder(path="authentication/steamchat.html")
else:
finder(path=str(p))
def deviceid(steamid):
if len(str(steamid)) == 17 and str(steamid).isdigit():
return getDeviceId(str(steamid))
else:
raise ValueError("Please enter proper steamId")
def setup(steamId, Oauth, UDID, logging=True):
if len(str(steamId)) == 17 and str(steamId).isdigit():
addAuth = AddAuthenticator()
return addAuth.registerAuthenticator(steamId, Oauth, UDID)
else:
raise ValueError("Please enter proper steamId")
def secrets():
with open('authentication/shared_secrets.json', 'r') as data:
return json.load(data)
def authcode(tm, secret):
obj = SteamGuard()
return obj.get_auth_code(int(tm), str(secret))
def confkey(tm, secret, tag):
obj = SteamGuard()
return obj.get_confirmation_key(int(tm), str(secret), tag)
def login(username, password, shared_secret):
_login = Login(str(username), str(password), str(shared_secret))
return _login.getInfo()