- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
Latest commit
57 lines (48 loc) · 1.97 KB
/
Copy pathmain.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
fromauthentication.oauthimportfinder
fromauthentication.setupimportAddAuthenticator
fromauthentication.deviceIdimportgetDeviceId
fromauthentication.guardimportSteamGuard
fromauthentication.loginimportLogin
importjson
defguide(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
"""
)
defoauth(*p):
iflen(p) <1:
finder(path="authentication/steamchat.html")
else:
finder(path=str(p))
defdeviceid(steamid):
iflen(str(steamid)) ==17andstr(steamid).isdigit():
returngetDeviceId(str(steamid))
else:
raiseValueError("Please enter proper steamId")
defsetup(steamId, Oauth, UDID, logging=True):
iflen(str(steamId)) ==17andstr(steamId).isdigit():
addAuth=AddAuthenticator()
returnaddAuth.registerAuthenticator(steamId, Oauth, UDID)
else:
raiseValueError("Please enter proper steamId")
defsecrets():
withopen('authentication/shared_secrets.json', 'r') asdata:
returnjson.load(data)
defauthcode(tm, secret):
obj=SteamGuard()
returnobj.get_auth_code(int(tm), str(secret))
defconfkey(tm, secret, tag):
obj=SteamGuard()
returnobj.get_confirmation_key(int(tm), str(secret), tag)
deflogin(username, password, shared_secret):
_login=Login(str(username), str(password), str(shared_secret))
return_login.getInfo()