Revert "Fix for aidg.club website being taken read-only"
This reverts commit 23a031d852
.
This commit is contained in:
parent
c3fdee68a8
commit
f58064e72c
24
aiserver.py
24
aiserver.py
|
@ -5782,27 +5782,11 @@ def importgame():
|
||||||
def importAidgRequest(id):
|
def importAidgRequest(id):
|
||||||
exitModes()
|
exitModes()
|
||||||
|
|
||||||
#prompts.aidg.club is dead now. They are serving up a sqllite db, so we'll download that if it's not already saved and use that instead
|
urlformat = "https://prompts.aidg.club/api/"
|
||||||
#urlformat = "https://prompts.aidg.club/api/"
|
req = requests.get(urlformat+id)
|
||||||
#req = requests.get(urlformat+id)
|
|
||||||
|
|
||||||
if not os.path.exists("aidgclub.db"):
|
|
||||||
import urllib.request
|
|
||||||
urllib.request.urlretrieve("https://prompts.aidg.club/backup.db", "aidgclub.db")
|
|
||||||
|
|
||||||
import sqlite3
|
|
||||||
con = sqlite3.connect("aidgclub.db")
|
|
||||||
cur = con.cursor()
|
|
||||||
js = {}
|
|
||||||
sql = "select * from Prompts where CorrelationId = {}".format(id)
|
|
||||||
for row in cur.execute(sql):
|
|
||||||
js['promptContent'] = row[6]
|
|
||||||
js['memory'] = row[3]
|
|
||||||
js['authorsNote'] = row[1]
|
|
||||||
js['worldInfos'] = []
|
|
||||||
for row in cur.execute("select * from WorldInfos where PromptId = {}".format(id)):
|
|
||||||
js['worldInfos'].append({'keys': row[2], 'entry': row[1]})
|
|
||||||
|
|
||||||
|
if(req.status_code == 200):
|
||||||
|
js = req.json()
|
||||||
|
|
||||||
# Import game state
|
# Import game state
|
||||||
vars.gamestarted = True
|
vars.gamestarted = True
|
||||||
|
|
Loading…
Reference in New Issue