feat: update wget.ts

This commit is contained in:
2025-01-19 13:29:14 +08:00
parent 294d523039
commit 28153b7b83
2 changed files with 3 additions and 4 deletions

View File

@@ -40,8 +40,8 @@
}, },
"wget.ts": { "wget.ts": {
"script_name": "wget.ts", "script_name": "wget.ts",
"script_length": 3909, "script_length": 3848,
"script_sha256": "3f9b61749f9db5d18e2a6ec29cc65f5209ff1c34db0711a4083b07432bebc562", "script_sha256": "02108963e530b4ae422172f93e373858e89206cfeb6b6df4ea74105600ee3a45",
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/wget.ts", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/wget.ts",
"single_script_file": true "single_script_file": true
} }

View File

@@ -4,7 +4,7 @@
// - https://docs.deno.com/examples/command_line_arguments/ // - https://docs.deno.com/examples/command_line_arguments/
// - https://jsr.io/@chiba/wget/1.0.0/mod.ts // - https://jsr.io/@chiba/wget/1.0.0/mod.ts
import { parseArgs } from "jsr:@std/cli/parse-args"; import {parseArgs} from "jsr:@std/cli/parse-args";
import { import {
clearLastLine, clearLastLine,
formatHumanTime, formatHumanTime,
@@ -31,7 +31,6 @@ function getOutputFilename(filename: string): string {
} }
function getFilenameFromUrl(url: string): string { function getFilenameFromUrl(url: string): string {
// response.headers.get("Content-Disposition") // TODO
const array = new URL(url).pathname.split("/"); const array = new URL(url).pathname.split("/");
let filename = array[array.length - 1].trim(); let filename = array[array.length - 1].trim();
if (!filename) { if (!filename) {