Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/info.json
  • Loading branch information
akl7777777 committed Dec 10, 2023
2 parents 4f77627 + 0f165a2 commit 9e52042
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 31 deletions.
42 changes: 42 additions & 0 deletions appcast.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,48 @@
{
"identifier": "com.akl.bob-plugin-akl-chatgpt-free-translate",
"versions": [
{
"version": "2.1.1",
"desc": "fix: 修复国内备用1",
"sha256": "cda8ad988c26d4ba54fbbc54b224721800981a4ad276de15fe291222e38879cc",
"url": "https://github.com/akl7777777/bob-plugin-akl-chatgpt-free-translate/releases/download/v2.1.1/bob-plugin-akl-chatgpt-free-translate_v2.1.1.bobplugin",
"minBobVersion": "0.5.0"
},
{
"version": "2.1.0",
"desc": "fix: 修复国内备用1",
"sha256": "1271501e14432708652f7a6887ccecccea56695fcc3e21277d195c668f9c230a",
"url": "https://github.com/akl7777777/bob-plugin-akl-chatgpt-free-translate/releases/download/v2.1.0/bob-plugin-akl-chatgpt-free-translate_v2.1.0.bobplugin",
"minBobVersion": "0.5.0"
},
{
"version": "2.0.9",
"desc": "新增功能点:#reset 重置所有设置",
"sha256": "95be3cba2d03eec66158857bde8aa06050fbfc4762f0097afe2025a65d51fcc6",
"url": "https://github.com/akl7777777/bob-plugin-akl-chatgpt-free-translate/releases/download/v2.0.9/bob-plugin-akl-chatgpt-free-translate_v2.0.9.bobplugin",
"minBobVersion": "0.5.0"
},
{
"version": "2.0.8",
"desc": "修复备用1",
"sha256": "00ede0217bc7d44749294b3a714513c6f60de042917fe478802f9ed77d6cc046",
"url": "https://github.com/akl7777777/bob-plugin-akl-chatgpt-free-translate/releases/download/v2.0.8/bob-plugin-akl-chatgpt-free-translate_v2.0.8.bobplugin",
"minBobVersion": "0.5.0"
},
{
"version": "2.0.7",
"desc": "修复备用1",
"sha256": "a2c356e0dec394c776fa6510148b789fd6e48b709473de43a6b19a385155cfbe",
"url": "https://github.com/akl7777777/bob-plugin-akl-chatgpt-free-translate/releases/download/v2.0.7/bob-plugin-akl-chatgpt-free-translate_v2.0.7.bobplugin",
"minBobVersion": "0.5.0"
},
{
"version": "2.0.6",
"desc": "去除长期无效的线路",
"sha256": "056fbc4f7c21293eb7f1aba9180909286a785dd499f9251febc37019d1ddac6a",
"url": "https://github.com/akl7777777/bob-plugin-akl-chatgpt-free-translate/releases/download/v2.0.6/bob-plugin-akl-chatgpt-free-translate_v2.0.6.bobplugin",
"minBobVersion": "0.5.0"
},
{
"version": "2.0.5",
"desc": "feat: 新增国内备用2",
Expand Down
5 changes: 5 additions & 0 deletions src/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ function writeFile({ value, fileName = configFileName }) {
function deleteFile(fileName = historyFileName) {
$file.delete(getFilePath(fileName));
}
function deleteAllFile() {
$file.delete(getFilePath(configFileName));
$file.delete(getFilePath(historyFileName));
}

exports.configFileName = configFileName;
exports.historyFileName = historyFileName;
exports.readFile = readFile;
exports.writeFile = writeFile;
exports.deleteFile = deleteFile;
exports.deleteAllFile = deleteAllFile;
28 changes: 1 addition & 27 deletions src/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"identifier": "com.akl.bob-plugin-akl-chatgpt-free-translate",
"version": "2.0.6",
"version": "2.1.2",
"category": "translate",
"name": "Free ChatGPT",
"summary": "免秘钥免启动任何服务调用ChatGPT",
Expand Down Expand Up @@ -147,32 +147,6 @@
{
"title": "正式版(备用2很快)",
"value": "default-back2"
},{
"title": "正式版(备用3限流3次/分)",
"value": "default-back2"
},{
"title": "正式版(备用5需要关梯子)",
"value": "default-back5"
},
{
"title": "海外线路(1)",
"value": "oversea-1"
},
{
"title": "Alpha版本",
"value": "alpha"
},
{
"title": "Beta版本",
"value": "beta"
},
{
"title": "Gamma版本",
"value": "gamma"
},
{
"title": "Delta版本",
"value": "delta"
}
],
"desc": "版本切换(默认正式版无特殊情况不用修改)"
Expand Down
6 changes: 3 additions & 3 deletions src/space1.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function translate(query, source_lang, target_lang, translate_text, comple
const L = Date.now();
const resp = await $http.request({
method: "POST",
url: random_safe('aHR0cHM6Ly8zdi5mcmVlLWNoYXQuYXNpYS9hcGkvZ2VuZXJhdGU='),
url: random_safe('aHR0cHM6Ly9zaGUxLmZyZWUtY2hhdC5hc2lhL2FwaS9kb25vdC1yZXZlcnNlLWVuZ2luZWVyaW5nLW1l'),
body: {
messages: A,
time: L,
Expand All @@ -40,7 +40,7 @@ async function translate(query, source_lang, target_lang, translate_text, comple
},
header: {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36'
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
}
});
if (resp.data) {
Expand Down Expand Up @@ -91,7 +91,7 @@ async function digestMessage(r) {
async function generateSignature(r) {
const {t: e, m: t} = r;
const n = {}.PUBLIC_SECRET_KEY;
const a = `${e}:${t}:${n}`;
const a = `${e}:${t}:please contact me through me@muspimerol.site`;
const rs = await digestMessage(a);
$log.error('==========' + rs)
return rs;
Expand Down
7 changes: 6 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var config = require('./config.js');
var {configFileName, readFile, writeFile, deleteFile} = require("./file");
var {configFileName, readFile, writeFile, deleteFile,deleteAllFile} = require("./file");

const langMap = new Map(config.supportedLanguages);
const langMapReverse = new Map(config.supportedLanguages.map(([standardLang, lang]) => [lang, standardLang]));
Expand Down Expand Up @@ -47,6 +47,11 @@ function getDirectiveResult(text) {
deleteFile();

return "已清除对话记录,你可以继续聊天。";
case "#重置":
case "#reset":
case "#Reset":
deleteAllFile();
return "已重置所有设置,你可以继续聊天。";
}

writeFile({
Expand Down

0 comments on commit 9e52042

Please sign in to comment.