From 31afd20b68a00a1cf0564b7941cb5cc1f73ba1bf Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 21 May 2025 22:31:12 +0200 Subject: fix unbuffered writing in channel info by downloading to memory first --- scripts/ytdlp_channel_info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ytdlp_channel_info.ts b/scripts/ytdlp_channel_info.ts index 803336c..b953e4f 100644 --- a/scripts/ytdlp_channel_info.ts +++ b/scripts/ytdlp_channel_info.ts @@ -17,7 +17,7 @@ async function dfile(path: string, url: string) { console.log(`thumbnail download ${path} from ${url}`); const r = await fetch(url) if (!r.body) return console.error("thumbnail download failed"); - await Deno.writeFile(path, r.body) + await Deno.writeFile(path, new Uint8Array(await r.arrayBuffer())) } async function save_infojson(url: string, key: string, data: { [key: string]: unknown }) { -- cgit v1.2.3-70-g09d2