This commit is contained in:
Maximilian Keßler 2023-05-14 19:11:42 +02:00
parent daefcad215
commit ebc98aa850
Signed by: max
GPG Key ID: BCC5A619923C0BA5

32
test.py
View File

@ -1,4 +1,6 @@
import json import json
import alive_progress
import requests import requests
from variants import Variant from variants import Variant
@ -7,7 +9,7 @@ from site_api import *
from download_data import download_games, detailed_export_game from download_data import download_games, detailed_export_game
from check_game import check_game from check_game import check_game
from compress import link from compress import link
from database.database import conn from database.database import conn, cur
from database.init_database import init_database_tables, populate_static_tables from database.init_database import init_database_tables, populate_static_tables
@ -23,12 +25,12 @@ def test_variant():
def check_missing_ids(): def check_missing_ids():
# start = 357849 # start = 357849
# end = 358154 # end = 358154
start = 358393 start = 358393
end = 358687 end = 358687
# broken_ids = [357913, 357914, 357915] # two of these are no variant # broken_ids = [357913, 357914, 357915] # two of these are no variant
# not_supported_ids = [357925, 357957, 358081] # not_supported_ids = [357925, 357957, 358081]
broken_ids = [358627, 358630, 358632] broken_ids = [358627, 358630, 358632]
not_supported_ids = [ not_supported_ids = [
] ]
@ -40,16 +42,18 @@ def check_missing_ids():
conn.commit() conn.commit()
if __name__ == "__main__": def export_all_seeds():
var_id = 964490 cur.execute(
check_missing_ids() "SELECT id FROM variants ORDER BY ID"
exit(0) )
var_ids = cur.fetchall()
for var in var_ids:
download_games(*var)
# detailed_export_game(var_id)
# turn, state = check_game(var_id) if __name__ == "__main__":
# if turn != 0: var_id = 964532
# print("https://hanab.live/replay/{}".format(var_id)) # export_all_seeds()
# print(turn, link(state))
# init_database_tables() # init_database_tables()
# populate_static_tables() # populate_static_tables()