🎥 Make videos programmatically with React
add file extension to base64 audio
Jonny Burger8d61182078b1
diff --git a/packages/renderer/src/assets/download-and-map-assets-to-file.ts b/packages/renderer/src/assets/download-and-map-assets-to-file.tsindex ab368ade9a..64afbde3c1 100644--- a/packages/renderer/src/assets/download-and-map-assets-to-file.ts+++ b/packages/renderer/src/assets/download-and-map-assets-to-file.ts@@ -194,13 +194,6 @@ export const downloadAsset = async ({const onProgress = onDownload(src);if (src.startsWith('data:')) {- const output = getSanitizedFilenameForAssetUrl({- contentDisposition: null,- downloadDir,- src,- contentType: null,- });- ensureOutputDirectory(output);const [assetDetails, assetData] = src.substring('data:'.length).split(',');if (!assetDetails.includes(';')) {const errMessage = [@@ -217,6 +210,14 @@ export const downloadAsset = async ({validateMimeType(mimeType, src);validateBufferEncoding(encoding, src);+ const output = getSanitizedFilenameForAssetUrl({+ contentDisposition: null,+ downloadDir,+ src,+ contentType: mimeType,+ });+ ensureOutputDirectory(output);+const buff = Buffer.from(assetData, encoding);fs.writeFileSync(output, buff);notifyAssetIsDownloaded({src, downloadMap, downloadDir, to: output});