youtube mp3 converter
v1.0.3
一個簡單的節點模組,用於下載 youtube 影片並將其轉換為 mp3。圍繞著 ytdl 和 ffmped 庫的簡單包裝器,它提供了一個很好且易於使用的 api 將 youtube 連結轉換為 mp3。
從 YouTube 下載影片或相應的音訊直接違反了他們的政策。在您自己的影片以外的其他影片上使用此模組可能會導致 YouTube 起訴您。
此模組依賴 ffmpeg 函式庫。確保您已安裝 ffmpeg。如果沒有,請參閱此處以了解安裝詳細資訊。
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
} )
該模組目前缺乏一些認真的測試。如果您想延長時間,請成為我的客人。