mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-25 16:08:00 +01:00
Revert "Fix for aidg.club website being taken read-only"
This reverts commit 23a031d852d6890e4fa6bde197a3aeb70ec7714b.
This commit is contained in:
parent
c3fdee68a8
commit
f58064e72c
24
aiserver.py
24
aiserver.py
@ -5782,27 +5782,11 @@ def importgame():
|
||||
def importAidgRequest(id):
|
||||
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/"
|
||||
#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]})
|
||||
urlformat = "https://prompts.aidg.club/api/"
|
||||
req = requests.get(urlformat+id)
|
||||
|
||||
if(req.status_code == 200):
|
||||
js = req.json()
|
||||
|
||||
# Import game state
|
||||
vars.gamestarted = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user