youtube mp3 converter
v1.0.3
Um módulo de nó simples para baixar vídeos do YouTube e convertê-los em mp3. Um wrapper simples em torno da biblioteca ytdl e ffmped, que fornece uma API agradável e fácil de usar para converter links do YouTube em mp3s.
Baixar vídeos ou seus respectivos áudios do youtube viola diretamente sua Política. Usar este módulo em outros vídeos que não o seu pode levar o YouTube a processá-lo.
Este módulo depende da biblioteca ffmpeg. Certifique-se de ter o ffmpeg instalado. Caso contrário, veja aqui os detalhes da instalação.
npm install youtube-mp3-converter
npm run test
// Sets up the downloader
const youtubeMp3Converter = require ( 'youtube-mp3-converter' )
// creates Download function
const convertLinkToMp3 = youtubeMp3Converter ( pathToSaveFiles )
// Downloads mp3 and Returns path were it was saved.
const pathToMp3 = await convertLinkToMp3 ( 'https://www.youtube.com/watch?v=_cyND_1y1k0' )
const youtubeMp3Converter = require ( 'youtube-mp3-converter' )
const convertLinkToMp3 = youtubeMp3Converter ( pathToSaveFiles )
const pathToMp3 = await convertLinkToMp3 ( 'https://www.youtube.com/watch?v=_cyND_1y1k0' , {
startTime : "00:00:10" , // from where in the video the mp3 should start
duration : 20 , // Length of mp3 in seconds (from start point)
title : 'fooo' // The tile of the mp3 file, undefined it takes the youtube title
} )
Atualmente, este módulo carece de alguns testes sérios. Se você quiser estender isso, fique à vontade.