From 517d0d22b74b41a7b787106bb646eca61953a4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=86=E8=96=AF=E9=A5=BC?= Date: Tue, 10 Dec 2024 15:57:04 +0800 Subject: [PATCH] feat: Console.logLevel Update arguments-builder.config.ts Update boxjs.settings.json Update database.mjs Update setENV.mjs --- arguments-builder.config.ts | 25 +- package-lock.json | 474 +++++++++++----------- package.json | 2 +- src/Composite.Subtitles.response.dev.js | 4 +- src/Composite.Subtitles.response.js | 3 +- src/External.Lyrics.response.dev.js | 4 +- src/External.Lyrics.response.js | 3 +- src/External.Subtitles.response.dev.js | 192 +++++---- src/Manifest.response.dev.js | 4 +- src/Manifest.response.js | 3 +- src/Translate.response.dev.js | 4 +- src/Translate.response.js | 3 +- src/database/API.json | 52 +-- src/database/Database.json | 20 +- src/database/Default.json | 40 +- src/database/Netflix.json | 1 - src/database/Spotify.json | 1 - src/database/Universal.json | 1 - src/database/YouTube.json | 52 ++- src/function/database.mjs | 502 ++++++++++++++++++++++++ src/function/setENV.mjs | 4 +- template/boxjs.settings.json | 2 +- 22 files changed, 969 insertions(+), 427 deletions(-) create mode 100644 src/function/database.mjs diff --git a/arguments-builder.config.ts b/arguments-builder.config.ts index eb8d05a0..b0eb168f 100644 --- a/arguments-builder.config.ts +++ b/arguments-builder.config.ts @@ -209,12 +209,12 @@ export default defineConfig({ type: "string", options: [ { - "key": "Google", - "label": "Google Translate" + key: "Google", + label: "Google Translate", }, { - "key": "Microsoft", - "label": "Microsoft Translator(需填写API)" + key: "Microsoft", + label: "Microsoft Translator(需填写API)", }, ], description: "请选择翻译器所使用的服务商API,更多翻译选项请使用BoxJs。", @@ -224,7 +224,22 @@ export default defineConfig({ name: "[翻译器] 只显示翻译字幕", defaultValue: false, type: "boolean", - description: "开启后仅显示翻译字幕,不做字幕合并操作。", + description: "是否仅显示翻译后字幕,不显示源语言字幕。", + }, + { + key: "LogLevel", + name: "[调试] 日志等级", + type: "string", + defaultValue: "WARN", + description: "选择脚本日志的输出等级,低于所选等级的日志将全部输出。", + options: [ + { key: "OFF", label: "关闭" }, + { key: "ERROR", label: "❌ 错误" }, + { key: "WARN", label: "⚠️ 警告" }, + { key: "INFO", label: "ℹ️ 信息" }, + { key: "DEBUG", label: "🅱️ 调试" }, + { key: "ALL", label: "全部" }, + ], }, ], }); diff --git a/package-lock.json b/package-lock.json index d9b8ff0c..c8c6ca7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "license": "Apache-2.0", "dependencies": { "@nsnanocat/url": "^1.2.4", - "@nsnanocat/util": "^1.7.5", + "@nsnanocat/util": "^1.7.6", "@protobuf-ts/runtime": "^2.9.4", "crypto-js": "^4.2.0", "text-encoding": "^0.7.0" @@ -147,21 +147,25 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.6.tgz", + "integrity": "sha512-e8fGuQbA+pfsS2fGGRZgciyzstnkNrZCRIuOzgej9WCxPjHW3fn6h9SoJC3MrvfylMegiJPse94+mBJGf/qltQ==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "1.4.16-beta.0", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, + "node_modules/@jridgewell/gen-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.16-beta.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.16-beta.0.tgz", + "integrity": "sha512-qiZJiTfyb00BApxRU7Apz/3jtlp4gKgOmCXlGQRlIQ5zg6U0uYIb8lZBfbiJ+TxAEJ+rczfY07+CExd8sTRo5w==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -173,17 +177,6 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/source-map": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", @@ -234,9 +227,9 @@ } }, "node_modules/@jsonjoy.com/json-pack": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.0.tgz", - "integrity": "sha512-zlQONA+msXPPwHWZMKFVS78ewFczIll5lXiVPwFPCZUsrOKdxc2AvxU1HoNBmMRhqDZUR9HkC3UOm+6pME6Xsg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.1.tgz", + "integrity": "sha512-osjeBqMJ2lb/j/M8NCPjs1ylqWIcTRTycIhVB5pt6LgzgeRSb0YRZ7j9RfA8wIUrsr/medIuhVyonXRZWLyfdw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -359,14 +352,14 @@ }, "node_modules/@nsnanocat/url": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nsnanocat/url/-/url-1.2.4.tgz", - "integrity": "sha512-PgiZN4+lzaPMKpzFQRWxu1m7uU3HhwQ3A6NbMy+W/uhcGOt/UMDzf4RqpmNux54pTNIY5/R/HP10zmsoMPp56A==", + "resolved": "https://npm.pkg.github.com/download/@nsnanocat/url/1.2.4/2082eae3928a4251b6d6b24e01f302fba3807abb", + "integrity": "sha512-n8RVlzD/JG4gT+ZI7RJ0eXD+hadIj/fEWMp9qnORkvT+3aaPdvDrK7YeLTDBTj+bBSiWKyDSWBj4f21cNPNo7A==", "license": "Apache-2.0" }, "node_modules/@nsnanocat/util": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/@nsnanocat/util/-/util-1.7.5.tgz", - "integrity": "sha512-9PQFQV4iRMx7y+m2oKBTEc7zE7Ci4cevbHYqlW7mHggSTM2eI2srLlJ8952vfwPt8hEcHS7do7Cx+6QAT0fodA==", + "version": "1.7.6", + "resolved": "https://npm.pkg.github.com/download/@nsnanocat/util/1.7.6/4c7a65d6e991a2bfe1dd19651874bd3b3779d740", + "integrity": "sha512-vttYKFHhpl1O5r6jCXwyQ1n8i6RJ0oMUhTjXV2B6HZI2yucPnxK4ZVlAcM1zxee5+Wm7acGxRZXLGVXg7HV9hA==", "license": "Apache-2.0", "dependencies": { "pako": "^2.1.0" @@ -446,16 +439,16 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.5.0.tgz", - "integrity": "sha512-6TQAc/5uRILE6deixJ1CR8rXyTbzXIXNgO1D0Woi9Bqicz2FV5iKP3BHYEg6o4UATCMcbQQ0jbmeaOkn/HQk2w==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.6.0.tgz", + "integrity": "sha512-jESwj3APl78YUWHf28s2EjL0OIxcvl1uLU6Ge68KQ9ZXNsekUcbdr9dCi6vEO8naXS18lWXCV56shVkPStzXSQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "debug": "^4.3.7", + "debug": "^4.4.0", "extract-zip": "^2.0.1", "progress": "^2.0.3", - "proxy-agent": "^6.4.0", + "proxy-agent": "^6.5.0", "semver": "^7.6.3", "tar-fs": "^3.0.6", "unbzip2-stream": "^1.4.3", @@ -469,9 +462,9 @@ } }, "node_modules/@puppeteer/browsers/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -535,27 +528,27 @@ } }, "node_modules/@rspack/binding": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-1.1.5.tgz", - "integrity": "sha512-RsSkgi56Q5XUXut0qweLSE1C4Ogcm7g/ueKoOgsbHAYVKrCs9/dTFlPHWSIAaI7QWh0GWEePR/MM2O2HIu+1rw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-1.1.6.tgz", + "integrity": "sha512-vfeBEgGOYVwqj5cQjGyvdfrr/BEihAHlyIsobL98FZjTF0uig+bj2yJUH5Ib5F0BpIUKVG3Pw0IjlUBqcVpZsQ==", "dev": true, "license": "MIT", "optionalDependencies": { - "@rspack/binding-darwin-arm64": "1.1.5", - "@rspack/binding-darwin-x64": "1.1.5", - "@rspack/binding-linux-arm64-gnu": "1.1.5", - "@rspack/binding-linux-arm64-musl": "1.1.5", - "@rspack/binding-linux-x64-gnu": "1.1.5", - "@rspack/binding-linux-x64-musl": "1.1.5", - "@rspack/binding-win32-arm64-msvc": "1.1.5", - "@rspack/binding-win32-ia32-msvc": "1.1.5", - "@rspack/binding-win32-x64-msvc": "1.1.5" + "@rspack/binding-darwin-arm64": "1.1.6", + "@rspack/binding-darwin-x64": "1.1.6", + "@rspack/binding-linux-arm64-gnu": "1.1.6", + "@rspack/binding-linux-arm64-musl": "1.1.6", + "@rspack/binding-linux-x64-gnu": "1.1.6", + "@rspack/binding-linux-x64-musl": "1.1.6", + "@rspack/binding-win32-arm64-msvc": "1.1.6", + "@rspack/binding-win32-ia32-msvc": "1.1.6", + "@rspack/binding-win32-x64-msvc": "1.1.6" } }, "node_modules/@rspack/binding-darwin-arm64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", - "integrity": "sha512-eEynmyPPl+OGYQ9LRFwiQosyRfcca3OQB73akqY4mqDRl39OyiBjq7347DLHJysgbm9z+B1bsiLuh2xc6mdclQ==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-1.1.6.tgz", + "integrity": "sha512-x9dxm2yyiMuL1FBwvWNNMs2/mEUJmRoSRgYb8pblR7HDaTRORrjBFCqhaYlGyAqtQaeUy7o2VAQlE0BavIiFYA==", "cpu": [ "arm64" ], @@ -567,9 +560,9 @@ ] }, "node_modules/@rspack/binding-darwin-x64": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", - "integrity": "sha512-I6HPRgogewU5v1OKe3noEzq2U1FCEYAbW+smy+lPvpTW+3X6PlVMzTT4oelhB0EXDQ+KxjXH9KpOKON1hg/JGg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-1.1.6.tgz", + "integrity": "sha512-o0seilveftGiDjy3VPxug20HmAgYyQbNEuagR3i93/t/PT/eWXHnik+C1jjwqcivZL1Zllqvy4tbZw393aROEQ==", "cpu": [ "x64" ], @@ -581,9 +574,9 @@ ] }, "node_modules/@rspack/binding-linux-arm64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", - "integrity": "sha512-LQnqucNa6Dr6y3By+/M2ARO4jDR3AM+PuCsHgzlYT0RDRLS+Ow3f50WbNBf7eI/DhrEA0aucYL3sz1ljguB3EA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.6.tgz", + "integrity": "sha512-4atnoknJx/c3KaQElsMIxHMpPf2jcRRdWsH/SdqJIRSrkWWakMK9Yv4TFwH680I4HDTMf1XLboMVScHzW8e+Mg==", "cpu": [ "arm64" ], @@ -595,9 +588,9 @@ ] }, "node_modules/@rspack/binding-linux-arm64-musl": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", - "integrity": "sha512-b9L/9HJxrWY4cezPWqgj28I9Xe2XxwLHu8x0CMGobwF2XKR0QQVLAst38RW/EusJ8TURdyvNEOuRZlWEIJuYOw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.6.tgz", + "integrity": "sha512-7QMtwUtgFpt3/Y3/X18fSyN+kk4H8ZnZ8tDzQskVWc/j2AQYShZq56XQYqrhClzwujcCVAHauIQ2eiuJ2ASGag==", "cpu": [ "arm64" ], @@ -609,9 +602,9 @@ ] }, "node_modules/@rspack/binding-linux-x64-gnu": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", - "integrity": "sha512-0az52ZXTg/ErCGC1v/oFLWByKAiXvng4euv+prwMWF6p1pA7lfLRLzdibDFO4KgC16Zlfcg3hqs7YikLng4x+w==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.6.tgz", + "integrity": "sha512-MTjDEfPn4TwHoqs5d5Fck06kmXiTHZctGIcRVfrpg0RK0r1NLEHN+oosavRZ9c9H70f34+NmcHk+/qvV4c8lWg==", "cpu": [ "x64" ], @@ -623,9 +616,9 @@ ] }, "node_modules/@rspack/binding-linux-x64-musl": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", - "integrity": "sha512-EF/LJTtCTkuti2gJnCyvXHC5Q2L5M4+RXm5kj9Bfu/t0Zmmfe6Jd5QUsifgogioeL0ZsH/Pou5QiiVcOFcqFKQ==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.6.tgz", + "integrity": "sha512-LqDw7PTVr/4ZuGA0izgDQfamfr72USFHltR1Qhy2YVC3JmDmhG/pQi13LHcOLVaGH1xoeyCmEPNJpVizzDxSjg==", "cpu": [ "x64" ], @@ -637,9 +630,9 @@ ] }, "node_modules/@rspack/binding-win32-arm64-msvc": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", - "integrity": "sha512-VEqhK6HwIHby6gtOkxIx66SkqYndiaP1ddZ3X39RLE40TY3KlNgfG/SzbN9J5Qb+8jjq3ogV8n50+wLEGkhiWw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.6.tgz", + "integrity": "sha512-RHApLM93YN0WdHpS35u2cm7VCqZ8Yg3CrNRL16VJtyT9e6MBqeScoe4XIgIWKPm7edFyedYAjLX0wQOApwfjkg==", "cpu": [ "arm64" ], @@ -651,9 +644,9 @@ ] }, "node_modules/@rspack/binding-win32-ia32-msvc": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.1.5.tgz", - "integrity": "sha512-Yi2BwYehc5/sRVgI7zTGYJKjnV8UszAJt/stWdFHaq82chHiuuF/tQd1WcBUq0Iin9ylBMo16mRJAuFkFmJ74Q==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.1.6.tgz", + "integrity": "sha512-Y6lx4q0eJawRfMPBo/AclTJAPTZ325DSPFBQJB3TnWh9Z2X7P7pQcYc8PHDmfDuYRIdg5WRsQRvVxihSvF7v8w==", "cpu": [ "ia32" ], @@ -665,9 +658,9 @@ ] }, "node_modules/@rspack/binding-win32-x64-msvc": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", - "integrity": "sha512-4UArXYqJO1Ni7TmCw1T11JnrwfpoThDdiQ9k1P1voBWK3bDahPEBOptk9ZPu2+ZuRX8hFrvumRKkLY3oy7fTMw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.6.tgz", + "integrity": "sha512-UuCsfhC/yNuU7xLASOxNXcmsXi2ZvBX14GkxvcdChw6q7IIGNYUKXo1zgR8C1PE/6qDSxmLxbRMS+71d0H3HQg==", "cpu": [ "x64" ], @@ -679,9 +672,9 @@ ] }, "node_modules/@rspack/cli": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/cli/-/cli-1.1.5.tgz", - "integrity": "sha512-R08aM5gEvRV9zSE9fIaTxT77Nu/kRtoghj9TqItFk0xTbFxai9jF1fwRTbnDv23yVGNCwPfwvPOmpqvrf3SGnQ==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/cli/-/cli-1.1.6.tgz", + "integrity": "sha512-404JTAadncCp81sDa7nGZdsT7r1Ry8fALR8Wkp9VMTUhWEFlbDGQvOTyali24pfyJxJTdsarSabmNhbDO5okJw==", "dev": true, "license": "MIT", "dependencies": { @@ -703,14 +696,14 @@ } }, "node_modules/@rspack/core": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rspack/core/-/core-1.1.5.tgz", - "integrity": "sha512-/FmxDeMuW8fJkhz8fHuCu7OiJHFKW78xclEu7LkEujWl4PqJgdWjUL/6FWIj50spRwj6PRfuc31hFSL4hbNfCA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@rspack/core/-/core-1.1.6.tgz", + "integrity": "sha512-q0VLphOF5VW2FEG7Vbdq3Ke4I74FbELE/8xmKghSalFtULLZ44SoSz8lyotfMim9GXIRFhDokAaH8WICmPxG+g==", "dev": true, "license": "MIT", "dependencies": { "@module-federation/runtime-tools": "0.5.1", - "@rspack/binding": "1.1.5", + "@rspack/binding": "1.1.6", "@rspack/lite-tapable": "1.0.1", "caniuse-lite": "^1.0.30001616" }, @@ -1269,43 +1262,15 @@ } }, "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "dev": true, "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, "engines": { "node": ">= 14" } }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1969,17 +1934,16 @@ } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" }, "engines": { "node": ">= 0.4" @@ -1988,6 +1952,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1999,9 +1977,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001686", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz", - "integrity": "sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA==", + "version": "1.0.30001687", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001687.tgz", + "integrity": "sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==", "dev": true, "funding": [ { @@ -2087,6 +2065,16 @@ "devtools-protocol": "*" } }, + "node_modules/chromium-bidi/node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/cipher-base": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.6.tgz", @@ -2692,6 +2680,21 @@ "url": "https://bevry.me/fund" } }, + "node_modules/dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -2714,9 +2717,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.70", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.70.tgz", - "integrity": "sha512-P6FPqAWIZrC3sHDAwBitJBs7N7IF58m39XVny7DFseQXK2eiMn7nNQizFf63mWDDUnFvaqsM8FI0+ZZfLkdUGA==", + "version": "1.5.72", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.72.tgz", + "integrity": "sha512-ZpSAUOZ2Izby7qnZluSrAlGgGQzucmFbN0n64dYzocYxnxV5ufurpj3VgEe4cUp7ir9LmeLxNYo8bVnlM8bQHw==", "dev": true, "license": "ISC", "peer": true @@ -2807,14 +2810,11 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -3039,9 +3039,9 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "license": "MIT", "dependencies": { @@ -3064,7 +3064,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -3079,6 +3079,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/extract-zip": { @@ -3103,9 +3107,9 @@ } }, "node_modules/extract-zip/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -3372,17 +3376,20 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.5.tgz", + "integrity": "sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==", "dev": true, "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -3423,9 +3430,9 @@ } }, "node_modules/get-uri/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -3577,22 +3584,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", - "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -3796,9 +3787,9 @@ } }, "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -3853,13 +3844,13 @@ "license": "MIT" }, "node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -3867,9 +3858,9 @@ } }, "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -4501,9 +4492,9 @@ } }, "node_modules/memfs": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.14.1.tgz", - "integrity": "sha512-Fq5CMEth+2iprLJ5mNizRcWuiwRZYjNkUD0zKk224jZunE9CRacTRDK8QLALbMBlNX2y3nY6lKZbesCwDwacig==", + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.15.0.tgz", + "integrity": "sha512-q9MmZXd2rRWHS6GU3WEm3HyiXZyyoA1DqdOhEq0lxPBmKb5S7IAOwX0RgUCwJfqjelDCySa5h8ujOy24LqsWcw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -4797,9 +4788,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT", "peer": true @@ -5088,29 +5079,29 @@ } }, "node_modules/pac-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", - "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz", + "integrity": "sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw==", "dev": true, "license": "MIT", "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.5", + "https-proxy-agent": "^7.0.6", "pac-resolver": "^7.0.1", - "socks-proxy-agent": "^8.0.4" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/pac-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -5278,9 +5269,9 @@ "license": "ISC" }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "dev": true, "license": "MIT" }, @@ -5393,29 +5384,29 @@ } }, "node_modules/proxy-agent": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", - "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "http-proxy-agent": "^7.0.1", - "https-proxy-agent": "^7.0.3", + "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.1", + "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.2" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -5485,18 +5476,18 @@ "license": "MIT" }, "node_modules/puppeteer": { - "version": "23.10.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.10.1.tgz", - "integrity": "sha512-kbcO+vu91fgUyBzEwByPe4q5lEEuBq4cuOZnZeRL42G7r5UrfbUFlxBJayXBLBsD6pREdk/92ZFwFQq3MaN6ww==", + "version": "23.10.2", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.10.2.tgz", + "integrity": "sha512-Iii2ZwdukXzEGeCxs2/GG8G+dbVCylnlBrTxZnMxLW/7w/ftoGq4VB2Bt1vwrbMIn1XwFqxYEWNEkZpIkcVfwg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@puppeteer/browsers": "2.5.0", + "@puppeteer/browsers": "2.6.0", "chromium-bidi": "0.8.0", "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1367902", - "puppeteer-core": "23.10.1", + "puppeteer-core": "23.10.2", "typed-query-selector": "^2.12.0" }, "bin": { @@ -5507,15 +5498,15 @@ } }, "node_modules/puppeteer-core": { - "version": "23.10.1", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.10.1.tgz", - "integrity": "sha512-ey6NwixHYEUnhCA/uYi7uQQ4a0CZw4k+MatbHXGl5GEzaiRQziYUxc2HGpdQZ/gnh4KQWAKkocyIg1/dIm5d0g==", + "version": "23.10.2", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.10.2.tgz", + "integrity": "sha512-SEPjEbhPxRlzjGRCs8skwfnzFQj6XrZZmoMz0JIQbanj0fBpQ5HOGgyQTyh4YOW33q+461plJc5GfsQ+ErVBgQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@puppeteer/browsers": "2.5.0", + "@puppeteer/browsers": "2.6.0", "chromium-bidi": "0.8.0", - "debug": "^4.3.7", + "debug": "^4.4.0", "devtools-protocol": "0.0.1367902", "typed-query-selector": "^2.12.0", "ws": "^8.18.0" @@ -5525,9 +5516,9 @@ } }, "node_modules/puppeteer-core/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6278,13 +6269,13 @@ } }, "node_modules/socks-proxy-agent": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", - "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.1.1", + "agent-base": "^7.1.2", "debug": "^4.3.4", "socks": "^2.8.3" }, @@ -6293,9 +6284,9 @@ } }, "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6372,9 +6363,9 @@ } }, "node_modules/spdy-transport/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6397,9 +6388,9 @@ "license": "MIT" }, "node_modules/spdy/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6659,9 +6650,9 @@ } }, "node_modules/terser": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", - "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", + "version": "5.37.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", + "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", "dev": true, "license": "BSD-2-Clause", "peer": true, @@ -6723,11 +6714,14 @@ "peer": true }, "node_modules/text-decoder": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.1.tgz", - "integrity": "sha512-x9v3H/lTKIJKQQe7RPQkLfKAnc9lUTkWDypIQgTzPJAq+5/GCDHonmshfvlsNSj58yyshbIJJDLmU15qNERrXQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.2.tgz", + "integrity": "sha512-/MDslo7ZyWTA2vnk1j7XoDVfXsGk3tp+zFEJHJGm0UjIlQifonVFwlVbQDFh8KJzTBnT8ie115TYqir6bclddA==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } }, "node_modules/text-encoding": { "version": "0.7.0", @@ -7110,9 +7104,9 @@ } }, "node_modules/webpack": { - "version": "5.97.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.0.tgz", - "integrity": "sha512-CWT8v7ShSfj7tGs4TLRtaOLmOCPWhoKEvp+eA7FVx8Xrjb3XfT0aXdxDItnRZmE8sHcH+a8ayDrJCOjXKxVFfQ==", + "version": "5.97.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", + "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", "dev": true, "license": "MIT", "peer": true, @@ -7757,9 +7751,9 @@ } }, "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.24.0", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.0.tgz", + "integrity": "sha512-Hz+wiY8yD0VLA2k/+nsg2Abez674dDGTai33SwNvMPuf9uIrBC9eFgIMQxBBbHFxVXi8W+5nX9DcAh9YNSQm/w==", "dev": true, "license": "MIT", "funding": { diff --git a/package.json b/package.json index 86d90a43..1e9ed3b7 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "@nsnanocat/url": "^1.2.4", - "@nsnanocat/util": "^1.7.5", + "@nsnanocat/util": "^1.7.6", "@protobuf-ts/runtime": "^2.9.4", "crypto-js": "^4.2.0", "text-encoding": "^0.7.0" diff --git a/src/Composite.Subtitles.response.dev.js b/src/Composite.Subtitles.response.dev.js index 51e6b819..b2f4c30f 100644 --- a/src/Composite.Subtitles.response.dev.js +++ b/src/Composite.Subtitles.response.dev.js @@ -2,14 +2,13 @@ import { Console, done, fetch, Lodash as _ } from "@nsnanocat/util"; import { URL } from "@nsnanocat/url"; import XML from "./XML/XML.mjs"; import VTT from "./WebVTT/WebVTT.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; import detectFormat from "./function/detectFormat.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; import setCache from "./function/setCache.mjs"; import constructSubtitlesQueue from "./function/constructSubtitlesQueue.mjs"; import Composite from "./class/Composite.mjs"; -Console.logLevel = "DEBUG"; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); @@ -30,6 +29,7 @@ Console.info(`FORMAT: ${FORMAT}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "Composite", "API"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/Composite.Subtitles.response.js b/src/Composite.Subtitles.response.js index 91e3918b..41d11cac 100644 --- a/src/Composite.Subtitles.response.js +++ b/src/Composite.Subtitles.response.js @@ -2,7 +2,7 @@ import { Console, done, fetch, Lodash as _ } from "@nsnanocat/util"; import { URL } from "@nsnanocat/url"; import XML from "./XML/XML.mjs"; import VTT from "./WebVTT/WebVTT.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; import detectFormat from "./function/detectFormat.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; @@ -29,6 +29,7 @@ Console.info(`FORMAT: ${FORMAT}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "Composite", "API"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/External.Lyrics.response.dev.js b/src/External.Lyrics.response.dev.js index 2c5658d7..aa9c7062 100644 --- a/src/External.Lyrics.response.dev.js +++ b/src/External.Lyrics.response.dev.js @@ -1,12 +1,11 @@ import { $app, Console, done, fetch, Lodash as _, Storage } from "@nsnanocat/util"; import LRC from "./LRC/LRC.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; import setCache from "./function/setCache.mjs"; import { BrowseResponse } from "./protobuf/google/protos/youtube/api/innertube/BrowseResponse.js"; import { ColorLyricsResponse } from "./protobuf/spotify/lyrics/Lyrics.js"; -Console.logLevel = "DEBUG"; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); @@ -26,6 +25,7 @@ Console.info(`FORMAT: ${FORMAT}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "External", "API"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/External.Lyrics.response.js b/src/External.Lyrics.response.js index fd1823b4..5c00a941 100644 --- a/src/External.Lyrics.response.js +++ b/src/External.Lyrics.response.js @@ -1,6 +1,6 @@ import { $app, Console, done, fetch, Lodash as _, Storage } from "@nsnanocat/util"; import LRC from "./LRC/LRC.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; import setCache from "./function/setCache.mjs"; @@ -25,6 +25,7 @@ Console.info(`FORMAT: ${FORMAT}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "External", "API"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/External.Subtitles.response.dev.js b/src/External.Subtitles.response.dev.js index 10438771..13c627b5 100644 --- a/src/External.Subtitles.response.dev.js +++ b/src/External.Subtitles.response.dev.js @@ -2,12 +2,11 @@ import { Console, done, fetch, Lodash as _ } from "@nsnanocat/util"; import { URL } from "@nsnanocat/url"; import XML from "./XML/XML.mjs"; import VTT from "./WebVTT/WebVTT.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; import detectFormat from "./function/detectFormat.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; import Composite from "./function/Composite.mjs"; -Console.logLevel = "DEBUG"; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); @@ -28,108 +27,101 @@ Console.info(`FORMAT: ${FORMAT}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "External", "API"], database); - Console.info(`Settings.Switch: ${Settings?.Switch}`); - switch (Settings.Switch) { - case true: + Console.logLevel = Settings.LogLevel; + // 获取字幕类型与语言 + const Type = url.searchParams?.get("subtype") ?? Settings.Type, + Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; + Console.info(`Type: ${Type}`, `Languages: ${Languages}`); + // 创建字幕请求队列 + let body = {}; + // 处理类型 + switch (Type) { + case "Official": + Console.info("官方字幕"); + break; + case "Translate": default: - // 获取字幕类型与语言 - const Type = url.searchParams?.get("subtype") ?? Settings.Type, - Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; - Console.info(`Type: ${Type}`, `Languages: ${Languages}`); - // 创建字幕请求队列 - let body = {}; - // 处理类型 - switch (Type) { - case "Official": - Console.info("官方字幕"); - break; - case "Translate": - default: - Console.info("翻译字幕"); - break; - case "External": - Console.info("外挂字幕"); - switch (Settings.SubVendor) { - case "URL": - request = { - url: Settings.URL, - headers: { - Accept: "*/*", - "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1", - }, - }; - break; - } - break; - } - // 创建字幕Object - let externalSubtitle = await fetch(request).then(response => response.body); - // 格式判断 - switch (FORMAT) { - case undefined: // 视为无body - break; - case "application/x-www-form-urlencoded": - case "text/plain": - default: - break; - case "application/x-mpegURL": - case "application/x-mpegurl": - case "application/vnd.apple.mpegurl": - case "audio/mpegurl": - //body = M3U8.parse($response.body); - //Console.debug(`body: ${JSON.stringify(body)}`); - //$response.body = M3U8.stringify(body); - break; - case "text/xml": - case "text/html": - case "text/plist": - case "application/xml": - case "application/plist": - case "application/x-plist": - body = XML.parse($response.body); - //Console.debug(`body: ${JSON.stringify(body)}`); - externalSubtitle = XML.parse(externalSubtitle); - //Console.debug(`externalSubtitle: ${JSON.stringify(externalSubtitle)}`); - body = Composite(body, externalSubtitle, FORMAT, URL.query?.kind, Settings.Offset, Settings.Tolerance, Settings.Position); - //Console.debug(`body: ${JSON.stringify(body)}`); - $response.body = XML.stringify(body); - break; - case "text/vtt": - case "application/vtt": - body = VTT.parse($response.body); - //Console.debug(`body: ${JSON.stringify(body)}`); - externalSubtitle = VTT.parse(externalSubtitle); - //Console.debug(`externalSubtitle: ${JSON.stringify(externalSubtitle)}`); - body = Composite(body, externalSubtitle, FORMAT, URL.query?.kind, Settings.Offset, Settings.Tolerance, Settings.Position); - //Console.debug(`body: ${JSON.stringify(body)}`); - $response.body = VTT.stringify(body); - break; - case "text/json": - case "application/json": - body = JSON.parse($response.body ?? "{}"); - //Console.debug(`body: ${JSON.stringify(body)}`); - externalSubtitle = JSON.parse(externalSubtitle); - //Console.debug(`externalSubtitle: ${JSON.stringify(externalSubtitle)}`); - body = Composite(body, externalSubtitle, FORMAT, URL.query?.kind, Settings.Offset, Settings.Tolerance, Settings.Position); - //Console.debug(`body: ${JSON.stringify(body)}`); - $response.body = JSON.stringify(body); - break; - case "application/protobuf": - case "application/x-protobuf": - case "application/vnd.google.protobuf": - case "application/grpc": - case "application/grpc+proto": - case "application/octet-stream": - //Console.debug(`$response.body: ${JSON.stringify($response.body)}`); - //let rawBody = ($app === "Quantumult X") ? new Uint8Array($response.bodyBytes ?? []) : $response.body ?? new Uint8Array(); - //Console.debug(`isBuffer? ${ArrayBuffer.isView(rawBody)}: ${JSON.stringify(rawBody)}`); - // 写入二进制数据 - //Console.debug(`rawBody: ${JSON.stringify(rawBody)}`); - //$response.body = rawBody; + Console.info("翻译字幕"); + break; + case "External": + Console.info("外挂字幕"); + switch (Settings.SubVendor) { + case "URL": + request = { + url: Settings.URL, + headers: { + Accept: "*/*", + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1", + }, + }; break; } break; - case false: + } + // 创建字幕Object + let externalSubtitle = await fetch(request).then(response => response.body); + // 格式判断 + switch (FORMAT) { + case undefined: // 视为无body + break; + case "application/x-www-form-urlencoded": + case "text/plain": + default: + break; + case "application/x-mpegURL": + case "application/x-mpegurl": + case "application/vnd.apple.mpegurl": + case "audio/mpegurl": + //body = M3U8.parse($response.body); + //Console.debug(`body: ${JSON.stringify(body)}`); + //$response.body = M3U8.stringify(body); + break; + case "text/xml": + case "text/html": + case "text/plist": + case "application/xml": + case "application/plist": + case "application/x-plist": + body = XML.parse($response.body); + //Console.debug(`body: ${JSON.stringify(body)}`); + externalSubtitle = XML.parse(externalSubtitle); + //Console.debug(`externalSubtitle: ${JSON.stringify(externalSubtitle)}`); + body = Composite(body, externalSubtitle, FORMAT, URL.query?.kind, Settings.Offset, Settings.Tolerance, Settings.Position); + //Console.debug(`body: ${JSON.stringify(body)}`); + $response.body = XML.stringify(body); + break; + case "text/vtt": + case "application/vtt": + body = VTT.parse($response.body); + //Console.debug(`body: ${JSON.stringify(body)}`); + externalSubtitle = VTT.parse(externalSubtitle); + //Console.debug(`externalSubtitle: ${JSON.stringify(externalSubtitle)}`); + body = Composite(body, externalSubtitle, FORMAT, URL.query?.kind, Settings.Offset, Settings.Tolerance, Settings.Position); + //Console.debug(`body: ${JSON.stringify(body)}`); + $response.body = VTT.stringify(body); + break; + case "text/json": + case "application/json": + body = JSON.parse($response.body ?? "{}"); + //Console.debug(`body: ${JSON.stringify(body)}`); + externalSubtitle = JSON.parse(externalSubtitle); + //Console.debug(`externalSubtitle: ${JSON.stringify(externalSubtitle)}`); + body = Composite(body, externalSubtitle, FORMAT, URL.query?.kind, Settings.Offset, Settings.Tolerance, Settings.Position); + //Console.debug(`body: ${JSON.stringify(body)}`); + $response.body = JSON.stringify(body); + break; + case "application/protobuf": + case "application/x-protobuf": + case "application/vnd.google.protobuf": + case "application/grpc": + case "application/grpc+proto": + case "application/octet-stream": + //Console.debug(`$response.body: ${JSON.stringify($response.body)}`); + //let rawBody = ($app === "Quantumult X") ? new Uint8Array($response.bodyBytes ?? []) : $response.body ?? new Uint8Array(); + //Console.debug(`isBuffer? ${ArrayBuffer.isView(rawBody)}: ${JSON.stringify(rawBody)}`); + // 写入二进制数据 + //Console.debug(`rawBody: ${JSON.stringify(rawBody)}`); + //$response.body = rawBody; break; } })() diff --git a/src/Manifest.response.dev.js b/src/Manifest.response.dev.js index 18882f6f..3c8cc719 100644 --- a/src/Manifest.response.dev.js +++ b/src/Manifest.response.dev.js @@ -2,14 +2,13 @@ import { Console, done, fetch, Lodash as _, Storage } from "@nsnanocat/util"; import { URL } from "@nsnanocat/url"; import M3U8 from "./EXTM3U/EXTM3U.mjs"; import AttrList from "./class/AttrList.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; import setENV from "./function/setENV.mjs"; import isStandard from "./function/isStandard.mjs"; import detectPlaylist from "./function/detectPlaylist.mjs"; import setCache from "./function/setCache.mjs"; import aPath from "./function/aPath.mjs"; -Console.logLevel = "DEBUG"; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); @@ -29,6 +28,7 @@ Console.info(`PLATFORM: ${PLATFORM}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "Composite"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/Manifest.response.js b/src/Manifest.response.js index bf3028e5..6d0e3e22 100644 --- a/src/Manifest.response.js +++ b/src/Manifest.response.js @@ -2,7 +2,7 @@ import { Console, done, fetch, Lodash as _, Storage } from "@nsnanocat/util"; import { URL } from "@nsnanocat/url"; import M3U8 from "./EXTM3U/EXTM3U.mjs"; import AttrList from "./class/AttrList.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; import setENV from "./function/setENV.mjs"; import isStandard from "./function/isStandard.mjs"; @@ -28,6 +28,7 @@ Console.info(`PLATFORM: ${PLATFORM}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "Composite"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/Translate.response.dev.js b/src/Translate.response.dev.js index eeb45eae..84ebba96 100644 --- a/src/Translate.response.dev.js +++ b/src/Translate.response.dev.js @@ -2,7 +2,7 @@ import { $app, Console, done, Lodash as _ } from "@nsnanocat/util"; import { URL } from "@nsnanocat/url"; import XML from "./XML/XML.mjs"; import VTT from "./WebVTT/WebVTT.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; import detectFormat from "./function/detectFormat.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; @@ -11,7 +11,6 @@ import Translate from "./class/Translate.mjs"; import { BrowseResponse } from "./protobuf/google/protos/youtube/api/innertube/BrowseResponse.js"; import { ColorLyricsResponse } from "./protobuf/spotify/lyrics/Lyrics.js"; import { WireType, UnknownFieldHandler, reflectionMergePartial, MESSAGE_TYPE, MessageType, BinaryReader, isJsonObject, typeofJsonValue, jsonWriteOptions } from "@protobuf-ts/runtime"; -Console.logLevel = "DEBUG"; /***************** Processing *****************/ // 解构URL const url = new URL($request.url); @@ -32,6 +31,7 @@ Console.info(`FORMAT: ${FORMAT}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "Translate", "API"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/Translate.response.js b/src/Translate.response.js index 7e5aa59f..5292e31a 100644 --- a/src/Translate.response.js +++ b/src/Translate.response.js @@ -2,7 +2,7 @@ import { $app, Console, done, Lodash as _ } from "@nsnanocat/util"; import { URL } from "@nsnanocat/url"; import XML from "./XML/XML.mjs"; import VTT from "./WebVTT/WebVTT.mjs"; -import database from "./database/index.mjs"; +import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; import detectFormat from "./function/detectFormat.mjs"; import detectPlatform from "./function/detectPlatform.mjs"; @@ -30,6 +30,7 @@ Console.info(`FORMAT: ${FORMAT}`); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("DualSubs", [["YouTube", "Netflix", "BiliBili", "Spotify"].includes(PLATFORM) ? PLATFORM : "Universal", "Translate", "API"], database); + Console.logLevel = Settings.LogLevel; // 获取字幕类型与语言 const Type = url.searchParams?.get("subtype") ?? Settings.Type, Languages = [url.searchParams?.get("lang")?.toUpperCase?.() ?? Settings.Languages[0], (url.searchParams?.get("tlang") ?? Caches?.tlang)?.toUpperCase?.() ?? Settings.Languages[1]]; diff --git a/src/database/API.json b/src/database/API.json index fcbf41cd..a633af84 100644 --- a/src/database/API.json +++ b/src/database/API.json @@ -1,28 +1,28 @@ { - "Settings": { - "GoogleCloud": { - "Version": "v2", - "Mode": "Key", - "Auth": "" - }, - "Microsoft": { - "Version": "Azure", - "Mode": "Token", - "Region": "", - "Auth": "" - }, - "DeepL": { - "Version": "Free", - "Auth": "" - }, - "DeepLX": { - "Endpoint": "", - "Auth": "" - }, - "URL": "", - "NeteaseMusic": { - "PhoneNumber": "", - "Password": "" - } - } + "Settings": { + "GoogleCloud": { + "Version": "v2", + "Mode": "Key", + "Auth": "" + }, + "Microsoft": { + "Version": "Azure", + "Mode": "Token", + "Region": "", + "Auth": "" + }, + "DeepL": { + "Version": "Free", + "Auth": "" + }, + "DeepLX": { + "Endpoint": "", + "Auth": "" + }, + "URL": "", + "NeteaseMusic": { + "PhoneNumber": "", + "Password": "" + } + } } diff --git a/src/database/Database.json b/src/database/Database.json index 37085212..d7f24366 100644 --- a/src/database/Database.json +++ b/src/database/Database.json @@ -1,16 +1,6 @@ { - "Default": { - "Settings": { - "Switch": true, - "Type": "Translate", - "Types": ["Official", "Translate"], - "Languages": ["EN", "ZH"], - "CacheSize": 50 - } - }, "Universal": { "Settings": { - "Switch": true, "Types": ["Official", "Translate"], "Languages": ["EN", "ZH"] }, @@ -69,7 +59,6 @@ }, "YouTube": { "Settings": { - "Switch": true, "Type": "Official", "Types": ["Translate", "External"], "Languages": ["AUTO", "ZH"], @@ -1892,7 +1881,6 @@ }, "Netflix": { "Settings": { - "Switch": true, "Type": "Translate", "Languages": ["AUTO", "ZH"] }, @@ -2165,5 +2153,13 @@ "Password": "" } } + }, + "Default": { + "Settings": { + "Type": "Translate", + "Types": ["Official", "Translate"], + "Languages": ["EN", "ZH"], + "CacheSize": 50 + } } } diff --git a/src/database/Default.json b/src/database/Default.json index eb1f3b66..3f7767a9 100644 --- a/src/database/Default.json +++ b/src/database/Default.json @@ -1,25 +1,19 @@ { - "Settings": { - "Switch": true, - "Type": "Translate", - "Types": [ - "Official", - "Translate" - ], - "Languages": [ - "EN", - "ZH" - ], - "CacheSize": 50 - }, - "Configs":{ - "breakLine":{ - "text/xml":" ", - "application/xml":" ", - "text/vtt":"\n", - "application/vtt":"\n", - "text/json":"\n", - "application/json":"\n" - } - } + "Settings": { + "Type": "Translate", + "Types": ["Official", "Translate"], + "Languages": ["EN", "ZH"], + "CacheSize": 50, + "LogLevel": "WARN" + }, + "Configs": { + "breakLine": { + "text/xml": " ", + "application/xml": " ", + "text/vtt": "\n", + "application/vtt": "\n", + "text/json": "\n", + "application/json": "\n" + } + } } diff --git a/src/database/Netflix.json b/src/database/Netflix.json index e0749cd4..a0e31b69 100644 --- a/src/database/Netflix.json +++ b/src/database/Netflix.json @@ -1,6 +1,5 @@ { "Settings": { - "Switch": true, "Type": "Translate", "Languages": ["AUTO", "ZH"] }, diff --git a/src/database/Spotify.json b/src/database/Spotify.json index 17f4c54b..64f84ed4 100644 --- a/src/database/Spotify.json +++ b/src/database/Spotify.json @@ -1,6 +1,5 @@ { "Settings": { - "Switch": true, "Types": ["Translate", "External"], "Languages": ["AUTO", "ZH"] } diff --git a/src/database/Universal.json b/src/database/Universal.json index 7c454eca..5d3494d1 100644 --- a/src/database/Universal.json +++ b/src/database/Universal.json @@ -1,6 +1,5 @@ { "Settings": { - "Switch": true, "Types": ["Official", "Translate"], "Languages": ["AUTO", "ZH"] }, diff --git a/src/database/YouTube.json b/src/database/YouTube.json index b79066b7..4a9b7040 100644 --- a/src/database/YouTube.json +++ b/src/database/YouTube.json @@ -1,7 +1,55 @@ { - "Settings": { "Switch": true, "Type": "Official", "Types": ["Translate", "External"], "Languages": ["AUTO", "ZH"], "AutoCC": true, "ShowOnly": false }, + "Settings": { + "Type": "Official", + "Types": ["Translate", "External"], + "Languages": ["AUTO", "ZH"], + "AutoCC": true, + "ShowOnly": false + }, "Configs": { - "Languages": { "BG": "bg-BG", "CS": "cs", "DA": "da-DK", "DE": "de", "EL": "el", "EN": "en", "EN-GB": "en-GB", "EN-US": "en-US", "EN-US SDH": "en-US SDH", "ES": "es", "ES-419": "es-419", "ES-ES": "es-ES", "ET": "et-EE", "FI": "fi", "FR": "fr", "HU": "hu-HU", "ID": "id", "IS": "is-IS", "IT": "it", "JA": "ja", "KO": "ko", "LT": "lt-LT", "LV": "lv-LV", "NL": "nl-NL", "NO": "nb-NO", "PL": "pl-PL", "PT": "pt", "PT-PT": "pt-PT", "PT-BR": "pt-BR", "RO": "ro-RO", "RU": "ru-RU", "SK": "sk-SK", "SL": "sl-SI", "SV": "sv-SE", "YUE": "yue", "YUE-HK": "yue-HK", "ZH": "zh", "ZH-HANS": "zh-Hans", "ZH-HK": "zh-Hant-HK", "ZH-HANT": "zh-Hant", "ZH-TW": "zh-TW" }, + "Languages": { + "BG": "bg-BG", + "CS": "cs", + "DA": "da-DK", + "DE": "de", + "EL": "el", + "EN": "en", + "EN-GB": "en-GB", + "EN-US": "en-US", + "EN-US SDH": "en-US SDH", + "ES": "es", + "ES-419": "es-419", + "ES-ES": "es-ES", + "ET": "et-EE", + "FI": "fi", + "FR": "fr", + "HU": "hu-HU", + "ID": "id", + "IS": "is-IS", + "IT": "it", + "JA": "ja", + "KO": "ko", + "LT": "lt-LT", + "LV": "lv-LV", + "NL": "nl-NL", + "NO": "nb-NO", + "PL": "pl-PL", + "PT": "pt", + "PT-PT": "pt-PT", + "PT-BR": "pt-BR", + "RO": "ro-RO", + "RU": "ru-RU", + "SK": "sk-SK", + "SL": "sl-SI", + "SV": "sv-SE", + "YUE": "yue", + "YUE-HK": "yue-HK", + "ZH": "zh", + "ZH-HANS": "zh-Hans", + "ZH-HK": "zh-Hant-HK", + "ZH-HANT": "zh-Hant", + "ZH-TW": "zh-TW" + }, "translationLanguages": { "DESKTOP": [ { "languageCode": "sq", "languageName": { "simpleText": "Shqip - 阿尔巴尼亚语" } }, diff --git a/src/function/database.mjs b/src/function/database.mjs new file mode 100644 index 00000000..c62ea4ac --- /dev/null +++ b/src/function/database.mjs @@ -0,0 +1,502 @@ +export default { + Universal: { + Settings: { + Types: ["Official", "Translate"], + Languages: ["AUTO", "ZH"], + }, + Configs: { + Languages: { + AUTO: ["en", "en-US", "eng", "en-GB", "en-UK", "en-CA", "en-US SDH", "ja", "ja-JP", "jpn", "ko", "ko-KR", "kor", "pt", "pt-PT", "pt-BR", "por"], + AR: ["ar", "ar-001"], + BG: ["bg", "bg-BG", "bul"], + CS: ["cs", "cs-CZ", "ces"], + DA: ["da", "da-DK", "dan"], + DE: ["de", "de-DE", "deu"], + EL: ["el", "el-GR", "ell"], + EN: ["en", "en-US", "eng", "en-GB", "en-UK", "en-CA", "en-US SDH"], + "EN-CA": ["en-CA", "en", "eng"], + "EN-GB": ["en-UK", "en", "eng"], + "EN-US": ["en-US", "en", "eng"], + "EN-US SDH": ["en-US SDH", "en-US", "en", "eng"], + ES: ["es", "es-419", "es-ES", "spa", "es-419 SDH"], + "ES-419": ["es-419", "es", "spa"], + "ES-419 SDH": ["es-419 SDH", "es-419", "es", "spa"], + "ES-ES": ["es-ES", "es", "spa"], + ET: ["et", "et-EE", "est"], + FI: ["fi", "fi-FI", "fin"], + FR: ["fr", "fr-CA", "fr-FR", "fra"], + "FR-CA": ["fr-CA", "fr", "fra"], + "FR-DR": ["fr-FR", "fr", "fra"], + HU: ["hu", "hu-HU", "hun"], + ID: ["id", "id-id"], + IT: ["it", "it-IT", "ita"], + JA: ["ja", "ja-JP", "jpn"], + KO: ["ko", "ko-KR", "kor"], + LT: ["lt", "lt-LT", "lit"], + LV: ["lv", "lv-LV", "lav"], + NL: ["nl", "nl-NL", "nld"], + NO: ["no", "nb-NO", "nor"], + PL: ["pl", "pl-PL"], + PT: ["pt", "pt-PT", "pt-BR", "por"], + "PT-PT": ["pt-PT", "pt", "por"], + "PT-BR": ["pt-BR", "pt", "por"], + RO: ["ro", "ro-RO", "ron"], + RU: ["ru", "ru-RU", "rus"], + SK: ["sk", "sk-SK", "slk"], + SL: ["sl", "sl-SI", "slv"], + SV: ["sv", "sv-SE", "swe"], + IS: ["is", "is-IS", "isl"], + ZH: ["zh", "cmn", "zho", "zh-CN", "zh-Hans", "cmn-Hans", "zh-TW", "zh-Hant", "cmn-Hant", "zh-HK", "yue-Hant", "yue"], + "ZH-CN": ["zh-CN", "zh-Hans", "cmn-Hans", "zho"], + "ZH-HANS": ["zh-Hans", "cmn-Hans", "zh-CN", "zho"], + "ZH-HK": ["zh-HK", "yue-Hant", "yue", "zho"], + "ZH-TW": ["zh-TW", "zh-Hant", "cmn-Hant", "zho"], + "ZH-HANT": ["zh-Hant", "cmn-Hant", "zh-TW", "zho"], + YUE: ["yue", "yue-Hant", "zh-HK", "zho"], + "YUE-HK": ["yue-Hant", "yue", "zh-HK", "zho"], + }, + }, + }, + YouTube: { + Settings: { + Type: "Official", + Types: ["Translate", "External"], + Languages: ["AUTO", "ZH"], + AutoCC: true, + ShowOnly: false, + }, + Configs: { + Languages: { + BG: "bg-BG", + CS: "cs", + DA: "da-DK", + DE: "de", + EL: "el", + EN: "en", + "EN-GB": "en-GB", + "EN-US": "en-US", + "EN-US SDH": "en-US SDH", + ES: "es", + "ES-419": "es-419", + "ES-ES": "es-ES", + ET: "et-EE", + FI: "fi", + FR: "fr", + HU: "hu-HU", + ID: "id", + IS: "is-IS", + IT: "it", + JA: "ja", + KO: "ko", + LT: "lt-LT", + LV: "lv-LV", + NL: "nl-NL", + NO: "nb-NO", + PL: "pl-PL", + PT: "pt", + "PT-PT": "pt-PT", + "PT-BR": "pt-BR", + RO: "ro-RO", + RU: "ru-RU", + SK: "sk-SK", + SL: "sl-SI", + SV: "sv-SE", + YUE: "yue", + "YUE-HK": "yue-HK", + ZH: "zh", + "ZH-HANS": "zh-Hans", + "ZH-HK": "zh-Hant-HK", + "ZH-HANT": "zh-Hant", + "ZH-TW": "zh-TW", + }, + translationLanguages: { + DESKTOP: [ + { languageCode: "sq", languageName: { simpleText: "Shqip - 阿尔巴尼亚语" } }, + { languageCode: "ak", languageName: { simpleText: "Ákán - 阿肯语" } }, + { languageCode: "ar", languageName: { simpleText: "العربية - 阿拉伯语" } }, + { languageCode: "am", languageName: { simpleText: "አማርኛ - 阿姆哈拉语" } }, + { languageCode: "as", languageName: { simpleText: "অসমীয়া - 阿萨姆语" } }, + { languageCode: "az", languageName: { simpleText: "آذربايجان ديلی - 阿塞拜疆语" } }, + { languageCode: "ee", languageName: { simpleText: "Èʋegbe - 埃维语" } }, + { languageCode: "ay", languageName: { simpleText: "Aymar aru - 艾马拉语" } }, + { languageCode: "ga", languageName: { simpleText: "Gaeilge - 爱尔兰语" } }, + { languageCode: "et", languageName: { simpleText: "Eesti - 爱沙尼亚语" } }, + { languageCode: "or", languageName: { simpleText: "ଓଡ଼ିଆ - 奥里亚语" } }, + { languageCode: "om", languageName: { simpleText: "Afaan Oromoo - 奥罗莫语" } }, + { languageCode: "eu", languageName: { simpleText: "Euskara - 巴斯克语" } }, + { languageCode: "be", languageName: { simpleText: "Беларуская - 白俄罗斯语" } }, + { languageCode: "bg", languageName: { simpleText: "Български - 保加利亚语" } }, + { languageCode: "nso", languageName: { simpleText: "Sesotho sa Leboa - 北索托语" } }, + { languageCode: "is", languageName: { simpleText: "Íslenska - 冰岛语" } }, + { languageCode: "pl", languageName: { simpleText: "Polski - 波兰语" } }, + { languageCode: "bs", languageName: { simpleText: "Bosanski - 波斯尼亚语" } }, + { languageCode: "fa", languageName: { simpleText: "فارسی - 波斯语" } }, + { languageCode: "bho", languageName: { simpleText: "भोजपुरी - 博杰普尔语" } }, + { languageCode: "ts", languageName: { simpleText: "Xitsonga - 聪加语" } }, + { languageCode: "tt", languageName: { simpleText: "Татарча - 鞑靼语" } }, + { languageCode: "da", languageName: { simpleText: "Dansk - 丹麦语" } }, + { languageCode: "de", languageName: { simpleText: "Deutsch - 德语" } }, + { languageCode: "dv", languageName: { simpleText: "ދިވެހިބަސް - 迪维希语" } }, + { languageCode: "ru", languageName: { simpleText: "Русский - 俄语" } }, + { languageCode: "fr", languageName: { simpleText: "français - 法语" } }, + { languageCode: "sa", languageName: { simpleText: "संस्कृतम् - 梵语" } }, + { languageCode: "fil", languageName: { simpleText: "Filipino - 菲律宾语" } }, + { languageCode: "fi", languageName: { simpleText: "suomi - 芬兰语" } }, + { languageCode: "km", languageName: { simpleText: "ភាសាខ្មែរ - 高棉语" } }, + { languageCode: "ka", languageName: { simpleText: "ქართული - 格鲁吉亚语" } }, + { languageCode: "gu", languageName: { simpleText: "ગુજરાતી - 古吉拉特语" } }, + { languageCode: "gn", languageName: { simpleText: "Avañe'ẽ - 瓜拉尼语" } }, + { languageCode: "kk", languageName: { simpleText: "Қазақ тілі - 哈萨克语" } }, + { languageCode: "ht", languageName: { simpleText: "Kreyòl ayisyen - 海地克里奥尔语" } }, + { languageCode: "ko", languageName: { simpleText: "한국어 - 韩语" } }, + { languageCode: "ha", languageName: { simpleText: "هَوُسَ - 豪萨语" } }, + { languageCode: "nl", languageName: { simpleText: "Nederlands - 荷兰语" } }, + { languageCode: "gl", languageName: { simpleText: "Galego - 加利西亚语" } }, + { languageCode: "ca", languageName: { simpleText: "català - 加泰罗尼亚语" } }, + { languageCode: "cs", languageName: { simpleText: "čeština - 捷克语" } }, + { languageCode: "kn", languageName: { simpleText: "ಕನ್ನಡ - 卡纳达语" } }, + { languageCode: "ky", languageName: { simpleText: "кыргыз тили - 吉尔吉斯语" } }, + { languageCode: "xh", languageName: { simpleText: "isiXhosa - 科萨语" } }, + { languageCode: "co", languageName: { simpleText: "corsu - 科西嘉语" } }, + { languageCode: "hr", languageName: { simpleText: "hrvatski - 克罗地亚语" } }, + { languageCode: "qu", languageName: { simpleText: "Runa Simi - 克丘亚语" } }, + { languageCode: "ku", languageName: { simpleText: "Kurdî - 库尔德语" } }, + { languageCode: "la", languageName: { simpleText: "lingua latīna - 拉丁语" } }, + { languageCode: "lv", languageName: { simpleText: "latviešu valoda - 拉脱维亚语" } }, + { languageCode: "lo", languageName: { simpleText: "ພາສາລາວ - 老挝语" } }, + { languageCode: "lt", languageName: { simpleText: "lietuvių kalba - 立陶宛语" } }, + { languageCode: "ln", languageName: { simpleText: "lingála - 林加拉语" } }, + { languageCode: "lg", languageName: { simpleText: "Luganda - 卢干达语" } }, + { languageCode: "lb", languageName: { simpleText: "Lëtzebuergesch - 卢森堡语" } }, + { languageCode: "rw", languageName: { simpleText: "Kinyarwanda - 卢旺达语" } }, + { languageCode: "ro", languageName: { simpleText: "Română - 罗马尼亚语" } }, + { languageCode: "mt", languageName: { simpleText: "Malti - 马耳他语" } }, + { languageCode: "mr", languageName: { simpleText: "मराठी - 马拉地语" } }, + { languageCode: "mg", languageName: { simpleText: "Malagasy - 马拉加斯语" } }, + { languageCode: "ml", languageName: { simpleText: "മലയാളം - 马拉雅拉姆语" } }, + { languageCode: "ms", languageName: { simpleText: "bahasa Melayu - 马来语" } }, + { languageCode: "mk", languageName: { simpleText: "македонски јазик - 马其顿语" } }, + { languageCode: "mi", languageName: { simpleText: "te reo Māori - 毛利语" } }, + { languageCode: "mn", languageName: { simpleText: "Монгол хэл - 蒙古语" } }, + { languageCode: "bn", languageName: { simpleText: "বাংলা - 孟加拉语" } }, + { languageCode: "my", languageName: { simpleText: "ဗမာစာ - 缅甸语" } }, + { languageCode: "hmn", languageName: { simpleText: "Hmoob - 苗语" } }, + { languageCode: "af", languageName: { simpleText: "Afrikaans - 南非荷兰语" } }, + { languageCode: "st", languageName: { simpleText: "Sesotho - 南索托语" } }, + { languageCode: "ne", languageName: { simpleText: "नेपाली - 尼泊尔语" } }, + { languageCode: "no", languageName: { simpleText: "Norsk - 挪威语" } }, + { languageCode: "pa", languageName: { simpleText: "ਪੰਜਾਬੀ - 旁遮普语" } }, + { languageCode: "pt", languageName: { simpleText: "Português - 葡萄牙语" } }, + { languageCode: "ps", languageName: { simpleText: "پښتو - 普什图语" } }, + { languageCode: "ny", languageName: { simpleText: "chiCheŵa - 齐切瓦语" } }, + { languageCode: "ja", languageName: { simpleText: "日本語 - 日语" } }, + { languageCode: "sv", languageName: { simpleText: "Svenska - 瑞典语" } }, + { languageCode: "sm", languageName: { simpleText: "Gagana fa'a Samoa - 萨摩亚语" } }, + { languageCode: "sr", languageName: { simpleText: "Српски језик - 塞尔维亚语" } }, + { languageCode: "si", languageName: { simpleText: "සිංහල - 僧伽罗语" } }, + { languageCode: "sn", languageName: { simpleText: "ChiShona - 绍纳语" } }, + { languageCode: "eo", languageName: { simpleText: "Esperanto - 世界语" } }, + { languageCode: "sk", languageName: { simpleText: "slovenčina - 斯洛伐克语" } }, + { languageCode: "sl", languageName: { simpleText: "slovenščina - 斯洛文尼亚语" } }, + { languageCode: "sw", languageName: { simpleText: "Kiswahili - 斯瓦希里语" } }, + { languageCode: "gd", languageName: { simpleText: "Gàidhlig - 苏格兰盖尔语" } }, + { languageCode: "ceb", languageName: { simpleText: "Binisaya - 宿务语" } }, + { languageCode: "so", languageName: { simpleText: "Soomaaliga - 索马里语" } }, + { languageCode: "tg", languageName: { simpleText: "тоҷикӣ - 塔吉克语" } }, + { languageCode: "te", languageName: { simpleText: "తెలుగు - 泰卢固语" } }, + { languageCode: "ta", languageName: { simpleText: "தமிழ் - 泰米尔语" } }, + { languageCode: "th", languageName: { simpleText: "ไทย - 泰语" } }, + { languageCode: "ti", languageName: { simpleText: "ትግርኛ - 提格利尼亚语" } }, + { languageCode: "tr", languageName: { simpleText: "Türkçe - 土耳其语" } }, + { languageCode: "tk", languageName: { simpleText: "Türkmen - 土库曼语" } }, + { languageCode: "cy", languageName: { simpleText: "Cymraeg - 威尔士语" } }, + { languageCode: "ug", languageName: { simpleText: "ئۇيغۇرچە - 维吾尔语" } }, + { languageCode: "und", languageName: { simpleText: "Unknown - 未知语言" } }, + { languageCode: "ur", languageName: { simpleText: "اردو - 乌尔都语" } }, + { languageCode: "uk", languageName: { simpleText: "українська - 乌克兰语" } }, + { languageCode: "uz", languageName: { simpleText: "O'zbek - 乌兹别克语" } }, + { languageCode: "es", languageName: { simpleText: "Español - 西班牙语" } }, + { languageCode: "fy", languageName: { simpleText: "Frysk - 西弗里西亚语" } }, + { languageCode: "iw", languageName: { simpleText: "עברית - 希伯来语" } }, + { languageCode: "el", languageName: { simpleText: "Ελληνικά - 希腊语" } }, + { languageCode: "haw", languageName: { simpleText: "ʻŌlelo Hawaiʻi - 夏威夷语" } }, + { languageCode: "sd", languageName: { simpleText: "سنڌي - 信德语" } }, + { languageCode: "hu", languageName: { simpleText: "magyar - 匈牙利语" } }, + { languageCode: "su", languageName: { simpleText: "Basa Sunda - 巽他语" } }, + { languageCode: "hy", languageName: { simpleText: "հայերեն - 亚美尼亚语" } }, + { languageCode: "ig", languageName: { simpleText: "Igbo - 伊博语" } }, + { languageCode: "it", languageName: { simpleText: "Italiano - 意大利语" } }, + { languageCode: "yi", languageName: { simpleText: "ייִדיש - 意第绪语" } }, + { languageCode: "hi", languageName: { simpleText: "हिन्दी - 印地语" } }, + { languageCode: "id", languageName: { simpleText: "Bahasa Indonesia - 印度尼西亚语" } }, + { languageCode: "en", languageName: { simpleText: "English - 英语" } }, + { languageCode: "yo", languageName: { simpleText: "Yorùbá - 约鲁巴语" } }, + { languageCode: "vi", languageName: { simpleText: "Tiếng Việt - 越南语" } }, + { languageCode: "jv", languageName: { simpleText: "Basa Jawa - 爪哇语" } }, + { languageCode: "zh-Hant", languageName: { simpleText: "中文(繁體)- 中文(繁体)" } }, + { languageCode: "zh-Hans", languageName: { simpleText: "中文(简体)" } }, + { languageCode: "zu", languageName: { simpleText: "isiZulu - 祖鲁语" } }, + { languageCode: "kri", languageName: { simpleText: "Krìì - 克里语" } }, + ], + MOBILE: [ + { languageCode: "sq", languageName: { runs: [{ text: "Shqip - 阿尔巴尼亚语" }] } }, + { languageCode: "ak", languageName: { runs: [{ text: "Ákán - 阿肯语" }] } }, + { languageCode: "ar", languageName: { runs: [{ text: "العربية - 阿拉伯语" }] } }, + { languageCode: "am", languageName: { runs: [{ text: "አማርኛ - 阿姆哈拉语" }] } }, + { languageCode: "as", languageName: { runs: [{ text: "অসমীয়া - 阿萨姆语" }] } }, + { languageCode: "az", languageName: { runs: [{ text: "Azərbaycanca - 阿塞拜疆语" }] } }, + { languageCode: "ee", languageName: { runs: [{ text: "Eʋegbe - 埃维语" }] } }, + { languageCode: "ay", languageName: { runs: [{ text: "Aymar - 艾马拉语" }] } }, + { languageCode: "ga", languageName: { runs: [{ text: "Gaeilge - 爱尔兰语" }] } }, + { languageCode: "et", languageName: { runs: [{ text: "Eesti - 爱沙尼亚语" }] } }, + { languageCode: "or", languageName: { runs: [{ text: "ଓଡ଼ିଆ - 奥里亚语" }] } }, + { languageCode: "om", languageName: { runs: [{ text: "Oromoo - 奥罗莫语" }] } }, + { languageCode: "eu", languageName: { runs: [{ text: "Euskara - 巴斯克语" }] } }, + { languageCode: "be", languageName: { runs: [{ text: "Беларуская - 白俄罗斯语" }] } }, + { languageCode: "bg", languageName: { runs: [{ text: "Български - 保加利亚语" }] } }, + { languageCode: "nso", languageName: { runs: [{ text: "Sesotho sa Leboa - 北索托语" }] } }, + { languageCode: "is", languageName: { runs: [{ text: "Íslenska - 冰岛语" }] } }, + { languageCode: "pl", languageName: { runs: [{ text: "Polski - 波兰语" }] } }, + { languageCode: "bs", languageName: { runs: [{ text: "Bosanski - 波斯尼亚语" }] } }, + { languageCode: "fa", languageName: { runs: [{ text: "فارسی - 波斯语" }] } }, + { languageCode: "bho", languageName: { runs: [{ text: "भोजपुरी - 博杰普尔语" }] } }, + { languageCode: "ts", languageName: { runs: [{ text: "Xitsonga - 聪加语" }] } }, + { languageCode: "tt", languageName: { runs: [{ text: "Татарча - 鞑靼语" }] } }, + { languageCode: "da", languageName: { runs: [{ text: "Dansk - 丹麦语" }] } }, + { languageCode: "de", languageName: { runs: [{ text: "Deutsch - 德语" }] } }, + { languageCode: "dv", languageName: { runs: [{ text: "ދިވެހިބަސް - 迪维希语" }] } }, + { languageCode: "ru", languageName: { runs: [{ text: "Русский - 俄语" }] } }, + { languageCode: "fr", languageName: { runs: [{ text: "Français - 法语" }] } }, + { languageCode: "sa", languageName: { runs: [{ text: "संस्कृतम् - 梵语" }] } }, + { languageCode: "fil", languageName: { runs: [{ text: "Filipino - 菲律宾语" }] } }, + { languageCode: "fi", languageName: { runs: [{ text: "Suomi - 芬兰语" }] } }, + { languageCode: "km", languageName: { runs: [{ text: "ភាសាខ្មែរ - 高棉语" }] } }, + { languageCode: "ka", languageName: { runs: [{ text: "ქართული - 格鲁吉亚语" }] } }, + { languageCode: "gu", languageName: { runs: [{ text: "ગુજરાતી - 古吉拉特语" }] } }, + { languageCode: "gn", languageName: { runs: [{ text: "Avañe'ẽ - 瓜拉尼语" }] } }, + { languageCode: "kk", languageName: { runs: [{ text: "Қазақ тілі - 哈萨克语" }] } }, + { languageCode: "ht", languageName: { runs: [{ text: "海地克里奥尔语" }] } }, + { languageCode: "ko", languageName: { runs: [{ text: "한국말 - 韩语" }] } }, + { languageCode: "ha", languageName: { runs: [{ text: "هَوُسَ - 豪萨语" }] } }, + { languageCode: "nl", languageName: { runs: [{ text: "Nederlands - 荷兰语" }] } }, + { languageCode: "gl", languageName: { runs: [{ text: "Galego - 加利西亚语" }] } }, + { languageCode: "ca", languageName: { runs: [{ text: "Català - 加泰罗尼亚语" }] } }, + { languageCode: "cs", languageName: { runs: [{ text: "Čeština - 捷克语" }] } }, + { languageCode: "kn", languageName: { runs: [{ text: "ಕನ್ನಡ - 卡纳达语" }] } }, + { languageCode: "ky", languageName: { runs: [{ text: "Кыргызча - 吉尔吉斯语" }] } }, + { languageCode: "xh", languageName: { runs: [{ text: "isiXhosa - 科萨语" }] } }, + { languageCode: "co", languageName: { runs: [{ text: "Corsu - 科西嘉语" }] } }, + { languageCode: "hr", languageName: { runs: [{ text: "Hrvatski - 克罗地亚语" }] } }, + { languageCode: "qu", languageName: { runs: [{ text: "Runa Simi - 克丘亚语" }] } }, + { languageCode: "ku", languageName: { runs: [{ text: "Kurdî - 库尔德语" }] } }, + { languageCode: "la", languageName: { runs: [{ text: "lingua latīna - 拉丁语" }] } }, + { languageCode: "lv", languageName: { runs: [{ text: "Latviešu - 拉脱维亚语" }] } }, + { languageCode: "lo", languageName: { runs: [{ text: "ລາວ - 老挝语" }] } }, + { languageCode: "lt", languageName: { runs: [{ text: "Lietuvių - 立陶宛语" }] } }, + { languageCode: "ln", languageName: { runs: [{ text: "Lingála - 林加拉语" }] } }, + { languageCode: "lg", languageName: { runs: [{ text: "Luganda - 卢干达语" }] } }, + { languageCode: "lb", languageName: { runs: [{ text: "Lëtzebuergesch - 卢森堡语" }] } }, + { languageCode: "rw", languageName: { runs: [{ text: "Kinyarwanda - 卢旺达语" }] } }, + { languageCode: "ro", languageName: { runs: [{ text: "Română - 罗马尼亚语" }] } }, + { languageCode: "mt", languageName: { runs: [{ text: "Malti - 马耳他语" }] } }, + { languageCode: "mr", languageName: { runs: [{ text: "मराठी - 马拉地语" }] } }, + { languageCode: "mg", languageName: { runs: [{ text: "Malagasy - 马拉加斯语" }] } }, + { languageCode: "ml", languageName: { runs: [{ text: "മലയാളം - 马拉雅拉姆语" }] } }, + { languageCode: "ms", languageName: { runs: [{ text: "Bahasa Melayu - 马来语" }] } }, + { languageCode: "mk", languageName: { runs: [{ text: "македонски - 马其顿语" }] } }, + { languageCode: "mi", languageName: { runs: [{ text: "Māori - 毛利语" }] } }, + { languageCode: "mn", languageName: { runs: [{ text: "Монгол - 蒙古语" }] } }, + { languageCode: "bn", languageName: { runs: [{ text: "বাংলা - 孟加拉语" }] } }, + { languageCode: "my", languageName: { runs: [{ text: "ဗမာစာ - 缅甸语" }] } }, + { languageCode: "hmn", languageName: { runs: [{ text: "Hmoob - 苗语" }] } }, + { languageCode: "af", languageName: { runs: [{ text: "Afrikaans - 南非荷兰语" }] } }, + { languageCode: "st", languageName: { runs: [{ text: "Sesotho - 南索托语" }] } }, + { languageCode: "ne", languageName: { runs: [{ text: "नेपाली - 尼泊尔语" }] } }, + { languageCode: "no", languageName: { runs: [{ text: "Norsk - 挪威语" }] } }, + { languageCode: "pa", languageName: { runs: [{ text: "ਪੰਜਾਬੀ - 旁遮普语" }] } }, + { languageCode: "pt", languageName: { runs: [{ text: "Português - 葡萄牙语" }] } }, + { languageCode: "ps", languageName: { runs: [{ text: "پښتو - 普什图语" }] } }, + { languageCode: "ny", languageName: { runs: [{ text: "chiCheŵa - 齐切瓦语" }] } }, + { languageCode: "ja", languageName: { runs: [{ text: "日本語 - 日语" }] } }, + { languageCode: "sv", languageName: { runs: [{ text: "Svenska - 瑞典语" }] } }, + { languageCode: "sm", languageName: { runs: [{ text: "Gagana Samoa - 萨摩亚语" }] } }, + { languageCode: "sr", languageName: { runs: [{ text: "Српски језик - 塞尔维亚语" }] } }, + { languageCode: "si", languageName: { runs: [{ text: "සිංහල - 僧伽罗语" }] } }, + { languageCode: "sn", languageName: { runs: [{ text: "ChiShona - 绍纳语" }] } }, + { languageCode: "eo", languageName: { runs: [{ text: "Esperanto - 世界语" }] } }, + { languageCode: "sk", languageName: { runs: [{ text: "Slovenčina - 斯洛伐克语" }] } }, + { languageCode: "sl", languageName: { runs: [{ text: "Slovenščina - 斯洛文尼亚语" }] } }, + { languageCode: "sw", languageName: { runs: [{ text: "Kiswahili - 斯瓦希里语" }] } }, + { languageCode: "gd", languageName: { runs: [{ text: "Gàidhlig - 苏格兰盖尔语" }] } }, + { languageCode: "ceb", languageName: { runs: [{ text: "Cebuano - 宿务语" }] } }, + { languageCode: "so", languageName: { runs: [{ text: "Soomaaliga - 索马里语" }] } }, + { languageCode: "tg", languageName: { runs: [{ text: "тоҷикӣ - 塔吉克语" }] } }, + { languageCode: "te", languageName: { runs: [{ text: "తెలుగు - 泰卢固语" }] } }, + { languageCode: "ta", languageName: { runs: [{ text: "தமிழ் - 泰米尔语" }] } }, + { languageCode: "th", languageName: { runs: [{ text: "ไทย - 泰语" }] } }, + { languageCode: "ti", languageName: { runs: [{ text: "ትግርኛ - 提格利尼亚语" }] } }, + { languageCode: "tr", languageName: { runs: [{ text: "Türkçe - 土耳其语" }] } }, + { languageCode: "tk", languageName: { runs: [{ text: "Türkmen - 土库曼语" }] } }, + { languageCode: "cy", languageName: { runs: [{ text: "Cymraeg - 威尔士语" }] } }, + { languageCode: "ug", languageName: { runs: [{ text: "ئۇيغۇرچە - 维吾尔语" }] } }, + { languageCode: "und", languageName: { runs: [{ text: "Unknown - 未知语言" }] } }, + { languageCode: "ur", languageName: { runs: [{ text: "اردو - 乌尔都语" }] } }, + { languageCode: "uk", languageName: { runs: [{ text: "Українська - 乌克兰语" }] } }, + { languageCode: "uz", languageName: { runs: [{ text: "O‘zbek - 乌兹别克语" }] } }, + { languageCode: "es", languageName: { runs: [{ text: "Español - 西班牙语" }] } }, + { languageCode: "fy", languageName: { runs: [{ text: "Frysk - 西弗里西亚语" }] } }, + { languageCode: "iw", languageName: { runs: [{ text: "עברית - 希伯来语" }] } }, + { languageCode: "el", languageName: { runs: [{ text: "Ελληνικά - 希腊语" }] } }, + { languageCode: "haw", languageName: { runs: [{ text: "ʻŌlelo Hawaiʻi - 夏威夷语" }] } }, + { languageCode: "sd", languageName: { runs: [{ text: "سنڌي - 信德语" }] } }, + { languageCode: "hu", languageName: { runs: [{ text: "Magyar - 匈牙利语" }] } }, + { languageCode: "su", languageName: { runs: [{ text: "Basa Sunda - 巽他语" }] } }, + { languageCode: "hy", languageName: { runs: [{ text: "Հայերեն - 亚美尼亚语" }] } }, + { languageCode: "ig", languageName: { runs: [{ text: "Igbo - 伊博语" }] } }, + { languageCode: "it", languageName: { runs: [{ text: "Italiano - 意大利语" }] } }, + { languageCode: "yi", languageName: { runs: [{ text: "ייִדיש - 意第绪语" }] } }, + { languageCode: "hi", languageName: { runs: [{ text: "हिन्दी - 印地语" }] } }, + { languageCode: "id", languageName: { runs: [{ text: "Bahasa Indonesia - 印度尼西亚语" }] } }, + { languageCode: "en", languageName: { runs: [{ text: "English - 英语" }] } }, + { languageCode: "yo", languageName: { runs: [{ text: "Yorùbá - 约鲁巴语" }] } }, + { languageCode: "vi", languageName: { runs: [{ text: "Tiếng Việt - 越南语" }] } }, + { languageCode: "jv", languageName: { runs: [{ text: "Basa Jawa - 爪哇语" }] } }, + { languageCode: "zh-Hant", languageName: { runs: [{ text: "中文(繁體) - 中文(繁体)" }] } }, + { languageCode: "zh-Hans", languageName: { runs: [{ text: "中文(简体)" }] } }, + { languageCode: "zu", languageName: { runs: [{ text: "isiZulu - 祖鲁语" }] } }, + { languageCode: "kri", languageName: { runs: [{ text: "Krìì - 克里语" }] } }, + ], + }, + }, + }, + Netflix: { + Settings: { + Type: "Translate", + Languages: ["AUTO", "ZH"], + }, + Configs: { + Languages: { + AR: "ar", + CS: "cs", + DA: "da", + DE: "de", + EN: "en", + "EN-GB": "en-GB", + "EN-US": "en-US", + "EN-US SDH": "en-US SDH", + ES: "es", + "ES-419": "es-419", + "ES-ES": "es-ES", + FI: "fi", + FR: "fr", + HE: "he", + HR: "hr", + HU: "hu", + ID: "id", + IT: "it", + JA: "ja", + KO: "ko", + MS: "ms", + NB: "nb", + NL: "nl", + PL: "pl", + PT: "pt", + "PT-PT": "pt-PT", + "PT-BR": "pt-BR", + RO: "ro", + RU: "ru", + SV: "sv", + TH: "th", + TR: "tr", + UK: "uk", + VI: "vi", + IS: "is", + ZH: "zh", + "ZH-HANS": "zh-Hans", + "ZH-HK": "zh-HK", + "ZH-HANT": "zh-Hant", + }, + }, + }, + Spotify: { + Settings: { + Types: ["Translate", "External"], + Languages: ["AUTO", "ZH"], + }, + }, + Composite: { + Settings: { + CacheSize: 20, + ShowOnly: false, + Position: "Reverse", + Offset: 0, + Tolerance: 1000, + }, + }, + Translate: { + Settings: { + Vendor: "Google", + ShowOnly: false, + Position: "Forward", + CacheSize: 10, + Method: "Part", + Times: 3, + Interval: 500, + Exponential: true, + }, + }, + External: { + Settings: { + SubVendor: "URL", + LrcVendor: "NeteaseMusic", + CacheSize: 50, + }, + }, + API: { + Settings: { + GoogleCloud: { + Version: "v2", + Mode: "Key", + Auth: "", + }, + Microsoft: { + Version: "Azure", + Mode: "Token", + Region: "", + Auth: "", + }, + DeepL: { + Version: "Free", + Auth: "", + }, + DeepLX: { + Endpoint: "", + Auth: "", + }, + URL: "", + NeteaseMusic: { + PhoneNumber: "", + Password: "", + }, + }, + }, + Default: { + Settings: { + Type: "Translate", + Types: ["Official", "Translate"], + Languages: ["EN", "ZH"], + CacheSize: 50, + LogLevel: "WARN", + }, + Configs: { + breakLine: { + "text/xml": " ", + "application/xml": " ", + "text/vtt": "\n", + "application/vtt": "\n", + "text/json": "\n", + "application/json": "\n", + }, + }, + }, +}; diff --git a/src/function/setENV.mjs b/src/function/setENV.mjs index 4056f5d3..4ffcd4cf 100644 --- a/src/function/setENV.mjs +++ b/src/function/setENV.mjs @@ -13,15 +13,15 @@ export default function setENV(name, platforms, database) { const { Settings, Caches, Configs } = getStorage(name, platforms, database); /***************** Settings *****************/ if (!Array.isArray(Settings?.Types)) Settings.Types = Settings.Types ? [Settings.Types] : []; // 只有一个选项时,无逗号分隔 - Console.debug(`typeof Settings: ${typeof Settings}`, `Settings: ${JSON.stringify(Settings)}`); + Console.info(`typeof Settings: ${typeof Settings}`, `Settings: ${JSON.stringify(Settings)}`); /***************** Caches *****************/ - //Console.debug(`typeof Caches: ${typeof Caches}`, `Caches: ${JSON.stringify(Caches)}`); if (typeof Caches?.Playlists !== "object" || Array.isArray(Caches?.Playlists)) Caches.Playlists = {}; // 创建Playlists缓存 Caches.Playlists.Master = new Map(JSON.parse(Caches?.Playlists?.Master || "[]")); // Strings转Array转Map Caches.Playlists.Subtitle = new Map(JSON.parse(Caches?.Playlists?.Subtitle || "[]")); // Strings转Array转Map if (typeof Caches?.Subtitles !== "object") Caches.Subtitles = new Map(JSON.parse(Caches?.Subtitles || "[]")); // Strings转Array转Map if (typeof Caches?.Metadatas !== "object" || Array.isArray(Caches?.Metadatas)) Caches.Metadatas = {}; // 创建Playlists缓存 if (typeof Caches?.Metadatas?.Tracks !== "object") Caches.Metadatas.Tracks = new Map(JSON.parse(Caches?.Metadatas?.Tracks || "[]")); // Strings转Array转Map + //Console.debug(`typeof Caches: ${typeof Caches}`, `Caches: ${JSON.stringify(Caches)}`); /***************** Configs *****************/ Console.log("✅ Set Environment Variables"); return { Settings, Caches, Configs }; diff --git a/template/boxjs.settings.json b/template/boxjs.settings.json index d72ee3ba..f33e21a7 100644 --- a/template/boxjs.settings.json +++ b/template/boxjs.settings.json @@ -1 +1 @@ -[{"id":"@DualSubs.Universal.Settings.Types","name":"[字幕] 启用类型","type":"checkboxes","val":["Official","Translate"],"items":[{"key":"Official","label":"官方字幕(合成器)"},{"key":"Translate","label":"翻译字幕(翻译器)"}],"desc":"请选择要添加的字幕选项,如果为标准播放器,则会在字幕选项中新增勾选字幕选项。"},{"id":"@DualSubs.Universal.Settings.Languages[0]","name":"[字幕] 主语言(源语言)","type":"selects","val":"AUTO","items":[{"key":"AUTO","label":"自动 - Automatic"},{"key":"ZH","label":"中文(自动)"},{"key":"ZH-HANS","label":"中文(简体)"},{"key":"ZH-HK","label":"中文(香港)"},{"key":"ZH-HANT","label":"中文(繁体)"},{"key":"EN","label":"English - 英语(自动)"},{"key":"ES","label":"Español - 西班牙语(自动)"},{"key":"JA","label":"日本語 - 日语"},{"key":"KO","label":"한국어 - 韩语"},{"key":"DE","label":"Deutsch - 德语"},{"key":"FR","label":"Français - 法语"},{"key":"TR","label":"Türkçe - 土耳其语"},{"key":"KM","label":"ភាសាខ្មែរ - 高棉语"}],"desc":"当“主语言”字幕存在时,将生成“主语言/副语言(翻译)”与“主语言(外挂)”的字幕或字幕选项。"},{"id":"@DualSubs.Universal.Settings.Languages[1]","name":"[字幕] 副语言(目标语言)","type":"selects","val":"ZH","items":[{"key":"ZH","label":"中文(自动)"},{"key":"ZH-HANS","label":"中文(简体)"},{"key":"ZH-HK","label":"中文(香港)"},{"key":"ZH-HANT","label":"中文(繁体)"},{"key":"EN","label":"English - 英语(自动)"},{"key":"EN-US","label":"英语(美国)"},{"key":"ES","label":"Español - 西班牙语(自动)"},{"key":"ES-ES","label":"Español - 西班牙语"},{"key":"ES-419","label":"西班牙语(拉丁美洲)"},{"key":"JA","label":"日本語 - 日语"},{"key":"KO","label":"한국어 - 韩语"},{"key":"DE","label":"Deutsch - 德语"},{"key":"FR","label":"Français - 法语"},{"key":"TR","label":"Türkçe - 土耳其语"},{"key":"KM","label":"ភាសាខ្មែរ - 高棉语"}],"desc":"当“副语言”字幕存在时,将生成“副语言/主语言(官方)”的字幕或字幕选项。"},{"id":"@DualSubs.Universal.Settings.Position","name":"[字幕] 主语言(源语言)字幕位置","type":"selects","val":"Reverse","items":[{"key":"Forward","label":"上面(第一行)"},{"key":"Reverse","label":"下面(第二行)"}],"desc":"主语言(源语言)字幕的显示位置。"},{"id":"@DualSubs.Universal.Settings.Vendor","name":"[翻译器] 服务商API","type":"selects","val":"Google","items":[{"key":"Google","label":"Google Translate"},{"key":"Microsoft","label":"Microsoft Translator(需填写API)"}],"desc":"请选择翻译器所使用的服务商API,更多翻译选项请使用BoxJs。"},{"id":"@DualSubs.Universal.Settings.ShowOnly","name":"[翻译器] 只显示翻译字幕","type":"boolean","val":false,"desc":"开启后仅显示翻译字幕,不做字幕合并操作。"}] \ No newline at end of file +[{"id":"@DualSubs.Universal.Settings.Types","name":"[字幕] 启用类型","type":"checkboxes","val":["Official","Translate"],"items":[{"key":"Official","label":"官方字幕(合成器)"},{"key":"Translate","label":"翻译字幕(翻译器)"}],"desc":"请选择要添加的字幕选项,如果为标准播放器,则会在字幕选项中新增勾选字幕选项。"},{"id":"@DualSubs.Universal.Settings.Languages[0]","name":"[字幕] 主语言(源语言)","type":"selects","val":"AUTO","items":[{"key":"AUTO","label":"自动 - Automatic"},{"key":"ZH","label":"中文(自动)"},{"key":"ZH-HANS","label":"中文(简体)"},{"key":"ZH-HK","label":"中文(香港)"},{"key":"ZH-HANT","label":"中文(繁体)"},{"key":"EN","label":"English - 英语(自动)"},{"key":"ES","label":"Español - 西班牙语(自动)"},{"key":"JA","label":"日本語 - 日语"},{"key":"KO","label":"한국어 - 韩语"},{"key":"DE","label":"Deutsch - 德语"},{"key":"FR","label":"Français - 法语"},{"key":"TR","label":"Türkçe - 土耳其语"},{"key":"KM","label":"ភាសាខ្មែរ - 高棉语"}],"desc":"当“主语言”字幕存在时,将生成“主语言/副语言(翻译)”与“主语言(外挂)”的字幕或字幕选项。"},{"id":"@DualSubs.Universal.Settings.Languages[1]","name":"[字幕] 副语言(目标语言)","type":"selects","val":"ZH","items":[{"key":"ZH","label":"中文(自动)"},{"key":"ZH-HANS","label":"中文(简体)"},{"key":"ZH-HK","label":"中文(香港)"},{"key":"ZH-HANT","label":"中文(繁体)"},{"key":"EN","label":"English - 英语(自动)"},{"key":"EN-US","label":"英语(美国)"},{"key":"ES","label":"Español - 西班牙语(自动)"},{"key":"ES-ES","label":"Español - 西班牙语"},{"key":"ES-419","label":"西班牙语(拉丁美洲)"},{"key":"JA","label":"日本語 - 日语"},{"key":"KO","label":"한국어 - 韩语"},{"key":"DE","label":"Deutsch - 德语"},{"key":"FR","label":"Français - 法语"},{"key":"TR","label":"Türkçe - 土耳其语"},{"key":"KM","label":"ភាសាខ្មែរ - 高棉语"}],"desc":"当“副语言”字幕存在时,将生成“副语言/主语言(官方)”的字幕或字幕选项。"},{"id":"@DualSubs.Universal.Settings.Position","name":"[字幕] 主语言(源语言)字幕位置","type":"selects","val":"Reverse","items":[{"key":"Forward","label":"上面(第一行)"},{"key":"Reverse","label":"下面(第二行)"}],"desc":"主语言(源语言)字幕的显示位置。"},{"id":"@DualSubs.Universal.Settings.Vendor","name":"[翻译器] 服务商API","type":"selects","val":"Google","items":[{"key":"Google","label":"Google Translate"},{"key":"Microsoft","label":"Microsoft Translator(需填写API)"}],"desc":"请选择翻译器所使用的服务商API,更多翻译选项请使用BoxJs。"},{"id":"@DualSubs.Universal.Settings.ShowOnly","name":"[翻译器] 只显示翻译字幕","type":"boolean","val":false,"desc":"是否仅显示翻译后字幕,不显示源语言字幕。"},{"id":"@DualSubs.Universal.Settings.LogLevel","name":"[调试] 日志等级","type":"selects","val":"WARN","items":[{"key":"OFF","label":"关闭"},{"key":"ERROR","label":"❌ 错误"},{"key":"WARN","label":"⚠️ 警告"},{"key":"INFO","label":"ℹ️ 信息"},{"key":"DEBUG","label":"🅱️ 调试"},{"key":"ALL","label":"全部"}],"desc":"选择脚本日志的输出等级,低于所选等级的日志将全部输出。"}] \ No newline at end of file