ytdl-run
v0.2.1
Published
youtube-dl runner in node.js
Downloads
133
Readme
ytdl-run
youtube-dl runner in node.js
Install
yarn add ytdl-run
Usage
Basic
const ytdl = require('ytdl-run')
// supports async/await
(async _=>{
// download file into current working directory
await ytdl('https://www.youtube.com/watch?v=JQGRg8XBnB4')
console.log('downloaded!')
})()
Info
const info = await ytdl.getInfo('https://www.youtube.com/watch?v=JQGRg8XBnB4')
console.log(info.title) // [MV] MOMOLAND (모모랜드) _ BBoom BBoom (뿜뿜)
console.log(info.duration) // 210
Stream
const fs = require('fs')
ytdl.stream('https://www.youtube.com/watch?v=JQGRg8XBnB4')
.stdout
.pipe(fs.createWriteStream('video.mp4'))
Options
const opts = [
'-o', '%(title)s.%(ext)s',
'--audio-quality', '0',
'https://www.youtube.com/watch?v=JQGRg8XBnB4'
]
ytdl(opts)
Update to latest version
await ytdl.update() // => 2019.05.11 (Returns current version)
Related
License
MIT