Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

youtube-dl-installer-ng

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

youtube-dl-installer-ng

Platform independent binary installer of youtube-dl

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

youtube-dl-installer-ng

Last version Build Status Dependency status Dev Dependencies Status NPM Status

Platform independent binary installer of youtube-dl for node projects.

Fork of Kikobeats/youtube-dl-installer which has gone unmaintained for some time.

Install

$ npm install youtube-dl-installer-ng --save

Usage

Require this module in your js application. Doing so will ensure that the latest version of youtube-dl is installed on your system. @todo add where it gets installed

require('youtube-dl-installer')

Following that, you can directly invoke the youtube-dl binary using child_process`, or indirectly using a module such as youtube-dl or ytdl-run.

child_process example

'use strict'

require('youtube-dl-installer')
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)
})()

ytdl-run example

'use strict'

require('youtube-dl-installer');
var ytdl2 = require('ytdl-run');

const opts = [
  '-f', 'bestaudio', 'https://www.youtube.com/watch?v=IgbO5pilG5I'
];

ytdl.stream(opts)
  .stdout
  .pipe(fs.createWriteStream('video.mp4'))

Keywords

binary

FAQs

Package last updated on 05 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts