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