From 9956702df5fcec208829503e4bf404f87d53c8a8 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 12 Apr 2026 09:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Update=20script=20metadata=20and?= =?UTF-8?q?=20enhance=20wget.ts=20with=20token=20validation=20and=20permis?= =?UTF-8?q?sion=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-meta-v2.json | 6 +++--- single-scripts/wget.ts | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/script-meta-v2.json b/script-meta-v2.json index 1ab425d..d9f7879 100644 --- a/script-meta-v2.json +++ b/script-meta-v2.json @@ -367,11 +367,11 @@ }, "wget.ts": { "script_name": "wget.ts", - "script_length": 5225, - "script_sha256": "85351654565fa92b21d33706339ededb804eff1484eb2ddb1d9dda44de7f4809", + "script_length": 5251, + "script_sha256": "6eb6297108d7d3719ae3d25689cbb0fc790a1577533fa70d94134cd88adbb8ab", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/wget.ts", "single_script_file": true, "publish_time": 1737272626139, - "update_time": 1775958532700 + "update_time": 1775959013881 } } \ No newline at end of file diff --git a/single-scripts/wget.ts b/single-scripts/wget.ts index 29a95eb..2de4c9f 100755 --- a/single-scripts/wget.ts +++ b/single-scripts/wget.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env runts -- --allow-env --allow-import --allow-read --allow-write --allow-net +#!/usr/bin/env runts -- --allow-all // Reference: // - https://docs.deno.com/examples/command_line_arguments/ @@ -144,6 +144,9 @@ if (hatterProxy) { "play.hatter.me", "xgetfile-token", ); + if (!token) { + throw new Error(`Token not found`); + } realUrl = `https://play.hatter.me/xgetfile?__token=${ encodeURIComponent(token) }&url=${encodeURIComponent(url)}`; @@ -180,5 +183,5 @@ log.success( }`, ); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260412T094849+08:00.MEUCIG7syjAuNPOfrHQAfttO -// 2EmdB61bKIeShvk/abV5e7p1AiEAvxySKwi2Kw+QGjviTGLdB+CgiaciPp2OH1YRI7ozdls= +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260412T095641+08:00.MEYCIQC6Qwz7YNhcunDVIDzC +// HjRPVTi1+Ph4FbGDxZuR6lNiUwIhAJyJTsUPZrBT5GYm+9mIlN6mYCbMHce1aU6jYbe4fnyh