1.0.1 • Published 6 years ago

youtube-dl-installer v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

youtube-dl-installer

Last version Build Status Dependency status Dev Dependencies Status NPM Status Donate

Platform independent binary installer of youtube-dl for node projects

Install

$ npm install youtube-dl-installer --save

Usage

'use strict'

const { promisify } = require('util')
const execFile = promisify(require('child_process').execFile)

const getInfo = async url => {
  const args = [ '--dump-json', '-f', 'best', url ]
  const {stdout, stderr} = await execFile(youtubeDlPath, args)
  return stderr === '' ? JSON.parse(stdout) : {}
}

;(async () => {
  const payload = await getInfo('https://www.youtube.com/watch?v=hwMkbaS_M_c')
  console.log(payload)
})()

License

youtube-dl-installer © Kiko Beats, released under the MIT License. Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats

1.0.1

6 years ago

1.0.0

6 years ago