add method to search for broken seeeds

This commit is contained in:
Maximilian Keßler 2023-05-14 14:06:01 +02:00
parent 258b804576
commit 1e79452061
Signed by: max
GPG key ID: BCC5A619923C0BA5

38
test.py
View file

@ -1,9 +1,13 @@
import json
import requests
from variants import Variant
from variants import Suit, variant_name
from site_api import *
from download_data import download_games
from download_data import download_games, detailed_export_game
from check_game import check_game
from compress import link
from database.database import conn
from database.init_database import init_database_tables, populate_static_tables
@ -18,8 +22,38 @@ def test_variant():
print(var.__dict__)
def check_missing_ids():
# start = 357849
# end = 358154
start = 358393
end = 358687
# broken_ids = [357913, 357914, 357915] # two of these are no variant
# not_supported_ids = [357925, 357957, 358081]
broken_ids = [358627, 358630, 358632]
not_supported_ids = [
]
for game_id in range(start, end):
if game_id in broken_ids or game_id in not_supported_ids:
continue
print(game_id)
detailed_export_game(game_id)
conn.commit()
if __name__ == "__main__":
download_games(156)
var_id = 964490
check_missing_ids()
exit(0)
# detailed_export_game(var_id)
# turn, state = check_game(var_id)
# if turn != 0:
# print("https://hanab.live/replay/{}".format(var_id))
# print(turn, link(state))
# init_database_tables()
# populate_static_tables()
download_games(1)
print(variant_name(17888))
for page in range(0, 4):
r = api("variants/0?size=20&col[0]=0&page={}".format(page))