0.1.1 • Published 2 years ago

@alpacamybags118/yt-dlp-exec v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

yt-dlp-exec

A small wrapper around yt-dlp, which allows you to invoke it as a child process in your node project. Inspired by youtube-dl-exec. Made for personal use/learning, but anyone is welcome to use/extend it.

Features

  • Downloads appropriate yt-dlp for OS (see download-yt-dlp.js)
  • Allows you to pass any supported yt-dlp arguments

Requirements

  1. Node version 12 or greater

Install

npm install @alpacamybags118/yt-dlp-exec

Usage

Javascript

const yt = require('@alpacamybags118/yt-dlp-exec');

const result = yt.createYtDlpAsProcess('https://some.url', {
  f: 'bestaudio',
  preferFreeFormats: true,
});

result.on('exit', (exit) => {
  console.log(exit);
})

Typescript

import createYtDlpAsProcess from '@alpacamybags118/yt-dlp-exec'

const process = createYtDlpAsProcess(
	'https://some.url',
	{
		o: '-',
		q: '',
		f: 'bestaudio',
		preferFreeFormats: true,
		r: '100K',
	}
);

You can also pass custom process options (in execa format: see https://github.com/sindresorhus/execa) for more control over settings such as stdio.

const yt = require('@alpacamybags118/yt-dlp-exec');

const result = yt.createYtDlpAsProcess('https://some.url', {
  f: 'bestaudio',
  preferFreeFormats: true,
}, { stdio: ['pipe', 'pipe', 'pipe'] });

result.on('exit', (exit) => {
  console.log(exit);
})

Argument list fo commands uses dargs formatting. Returned child process is in execa format

0.1.0

2 years ago

0.1.1

2 years ago

0.0.7

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago