diff --git a/Start.bat b/Start.bat index bb8b25d0a..4cc857c49 100644 --- a/Start.bat +++ b/Start.bat @@ -1,2 +1,3 @@ call npm install -node server.js \ No newline at end of file +node server.js +pause \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8cfa1a6f5..bb3a10080 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "csrf-csrf": "^2.2.3", "exifreader": "^4.12.0", "express": "^4.18.2", + "gpt3-tokenizer": "^1.1.5", "ipaddr.js": "^2.0.1", "jimp": "^0.22.7", "json5": "^2.2.3", @@ -490,6 +491,11 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/array-keyed-map": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/array-keyed-map/-/array-keyed-map-2.1.3.tgz", + "integrity": "sha512-JIUwuFakO+jHjxyp4YgSiKXSZeC0U+R1jR94bXWBcVlFRBycqXlb+kH9JHxBGcxnVuSqx5bnn0Qz9xtSeKOjiA==" + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -1117,6 +1123,17 @@ "process": "^0.11.10" } }, + "node_modules/gpt3-tokenizer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/gpt3-tokenizer/-/gpt3-tokenizer-1.1.5.tgz", + "integrity": "sha512-O9iCL8MqGR0Oe9wTh0YftzIbysypNQmS5a5JG3cB3M4LMYjlAVvNnf8LUzVY9MrI7tj+YLY356uHtO2lLX2HpA==", + "dependencies": { + "array-keyed-map": "^2.1.3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", diff --git a/package.json b/package.json index 55066aef3..4f83820ae 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "csrf-csrf": "^2.2.3", "exifreader": "^4.12.0", "express": "^4.18.2", + "gpt3-tokenizer": "^1.1.5", "ipaddr.js": "^2.0.1", "jimp": "^0.22.7", "json5": "^2.2.3", diff --git a/poe-client.js b/poe-client.js index 01db60f1b..cb31323a6 100644 --- a/poe-client.js +++ b/poe-client.js @@ -29,9 +29,178 @@ const parent_path = path.resolve(__dirname); const queries_path = path.join(parent_path, "poe_graphql"); let queries = {}; +const cached_bots = {}; + const logger = console; -const user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"; +const user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"; + +function extractFormKey(html) { + const scriptRegex = /--> - - - + + + @@ -47,14 +45,15 @@ + -