From cf76776eb6920ff75c73e89fdd75907a6fbd9d08 Mon Sep 17 00:00:00 2001 From: stratuma Date: Mon, 8 Jul 2024 15:45:08 +0200 Subject: [PATCH] possible fix for typeerror: terminated --- src/api/routes/service/service.service.ts | 4 +++- src/api/services/audio.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/routes/service/service.service.ts b/src/api/routes/service/service.service.ts index aa66ded..fdc939f 100644 --- a/src/api/routes/service/service.service.ts +++ b/src/api/routes/service/service.service.ts @@ -1241,7 +1241,9 @@ async function downloadParts(parts: { filename: string; url: string }[], downloa console.log(`[Video DOWNLOAD] Fetching Part ${ind + 1}`) - const response = await fetch(part.url) + const rawres = await fetch(part.url) + + const response = rawres.clone() if (!response.ok) { throw Error(await response.text()) diff --git a/src/api/services/audio.ts b/src/api/services/audio.ts index 21ab922..e161146 100644 --- a/src/api/services/audio.ts +++ b/src/api/services/audio.ts @@ -53,7 +53,9 @@ export async function downloadMPDAudio( console.log(`[${name} DOWNLOAD] Fetching Part ${ind + 1}`) - const response = await fetch(part.url) + const rawres = await fetch(part.url) + + const response = rawres.clone() if (!response.ok) { throw Error(await response.text())