Allow non-browser requests to upload Networks and create tests

This commit is contained in:
Andrew Grant committed 2022-05-19 08:16:10 -04:00
1 parent 5fde447ff0
commit c31a9a0b2d
4 files changed
+83

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
import requests
# Basic Information:
# Test options must contain 'Threads={} Hash={}'
# Test Modes may either be of type 'SPRT' or 'GAMES'
# Syzygy settings are { 'OPTIONAL', 'REQUIRED', 'DISABLED' }
# Max Games is ignored unless test is of type 'GAMES'
# Networks must be assigned using their SHA256, not their name
# Networks with the value '' are used for tests without Networks
URL = 'http://chess.grantnet.us/scripts/'
data = {
'enginename' : '',
'source' : '',
'devbench' : '',
'devbranch' : '',
'devoptions' : '
'devnetwork' : '',
'basebench' : '',
'basebranch' : '',
'baseoptions' : '',
'basenetwork' : '',
'bookname' : '',
'timecontrol' : '',
'test_mode' : '',
'bounds' : '',
'confidence' : '',
'max_games' : '',
'priority' : '',
'throughput' : '',
'syzygy_adj' : '',
'syzygy_wdl' : '',
'username' : '',
'password' : '',
'action' : 'CREATE_TEST',
}
r = requests.post(URL, data=data)
print(r.text)
+17
View File
@@ -0,0 +1,17 @@
import requests
URL = 'http://chess.grantnet.us/scripts/'
FILENAME = ''
data = {
'engine' : '',
'name' : ''.
'username' : '',
'password' : '',
'action' : 'UPLOAD',
}
with open(FILENAME, 'rb') as file:
r = requests.post(URL, data=data, files={'netfile' : file})
print(r.text)