0

I use node-youtube-dl to have a stream to download a video and I want to convert it to mp3 using fluent-ffmmpeg. I also want to zip this mp3 audio to send to the client to download it but I cannot figure how to zip the mp3 audio. I find every corner of StackOverflow but I did not find any solution. Please help me! Thanks

const stream = youtubedl(url);
const videoTitle = await youtube.getVideoTitle(url);
const converter = new ffmpeg({ source: stream });
const zip = archiver('zip');

// This does not work since converter.toFormat('mp3') is not a stream
zip.append(converter.toFormat('mp3'), {
  name: `${videoTitle}.${toFormat}`
});
zip.finalize();

I really appreciate if you can help me! Thanks again

dnp1204
  • 471
  • 5
  • 14
  • The tags used are not related to the question. – szatmary Jul 31 '18 at 01:37
  • I am sorry. What's wrong with it? I think I only include tag that related to language and third party libraries that I use – dnp1204 Jul 31 '18 at 02:45
  • You are also using an PC or Mac, but you don’t need those tags either. What you are asking is unrelated to ffmpeg, YouTube, etc. It doesn’t matter what you are zipping. – szatmary Jul 31 '18 at 04:04

0 Answers0