diff --git a/route/api/youtube/index.js b/route/api/youtube/index.js index b4fd8d3..a71047e 100644 --- a/route/api/youtube/index.js +++ b/route/api/youtube/index.js @@ -51,7 +51,7 @@ r.get('/download', async c => { const fileInfo = store.get(file) let fn = file - if (fileInfo !== null && 'title' in fileInfo) fn = fileInfo.title + if (fileInfo !== null && 'title' in fileInfo) fn = `${fileInfo.title}.mp3` const rs = fs.createReadStream(fp) c.set('Content-disposition', `attachment; filename="${encodeURIComponent(fn)}"; filename*="utf8''${encodeURIComponent(fn)}";`)