diff --git a/utils/tools.ts b/utils/tools.ts index c9940d2..b75fac8 100644 --- a/utils/tools.ts +++ b/utils/tools.ts @@ -80,15 +80,14 @@ export function createScreenAdapter(): void { export const downloadVideo = async (url: string) => { try { - const modifyUrl = decodeURIComponent(url); - const response = await fetch(modifyUrl); + const response = await fetch(url); const blob = await response.blob(); const blobUrl = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = blobUrl; let filename = 'video.mp4'; try { - const parsed = new URL(modifyUrl); + const parsed = new URL(decodeURIComponent(url)); filename = parsed.pathname.split('/').pop() || 'video.mp4'; if (filename.includes('?')) filename = filename.split('?')[0]; if (filename.includes('#')) filename = filename.split('#')[0];