diff --git a/utils/tools.ts b/utils/tools.ts index a3cd219..a51de10 100644 --- a/utils/tools.ts +++ b/utils/tools.ts @@ -80,12 +80,13 @@ export function createScreenAdapter(): void { export const downloadVideo = async (url: string) => { try { - const response = await fetch(decodeURIComponent(url)); + const modifyUrl = decodeURIComponent(url); + const response = await fetch(modifyUrl); const blob = await response.blob(); const blobUrl = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = blobUrl; - a.download = url.split('/').pop() || 'video.mp4'; + a.download = modifyUrl.split('/').pop() || 'video.mp4'; document.body.appendChild(a); a.click(); document.body.removeChild(a);