-
Notifications
You must be signed in to change notification settings - Fork 0
/
banned.py
55 lines (51 loc) · 2.01 KB
/
banned.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
52
53
54
55
import time
import json
from pgoapi import PGoApi
from pgoapi.hash_server import HashServer
from pgoapi.exceptions import AuthException
def checkAccounts():
api = PGoApi()
api.activate_hash_server('')
bannedAccounts = []
goodAccounts = []
with open('accounts.json', 'r') as accountlist:
accounts = json.load(accountlist)
for account in accounts:
print(f"Checking {account['username']}...")
try:
api.set_authentication(provider=account['type'],
username=account['username'],
password=account['password'])
api.set_position(40.707259, -73.520977, 144.3)
request = api.create_request()
request.call(request)
time.sleep(1)
request = api.create_request()
request.get_player(player_locale = {'country': 'US', 'language': 'en', 'timezone': 'America/New_York'})
request.call(request)
time.sleep(1)
request = api.create_request()
request.download_remote_config_version(platform=1, app_version=7903)
request.check_challenge()
request.get_hatched_eggs()
request.get_inventory(last_timestamp_ms=0)
request.check_awarded_badges()
request.download_settings()
resp = request.call(request)
# print(resp)
if not resp['responses'].get('GET_INVENTORY'):
bannedAccounts.append(account)
print("\rbanned.")
else:
goodAccounts.append(account)
print("Good")
except AuthException:
bannedAccounts.append(account)
time.sleep(10)
print(f"found {len(bannedAccounts)} banned accounts and {len(goodAccounts)} unbanned accounts.")
with open('banned.json', 'w') as bf:
json.dump(bannedAccounts, bf)
with open('good.json', 'w') as gf:
json.dump(goodAccounts, gf)
if __name__ == '__main__':
checkAccounts()