Delivator / yt-dlp.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yt-dlp.js

Build Status npm version

Installation

Requirements

FFmpeg has to be installed to PATH

To install yt-dlp.js run npm install yt-dlp.js --save

To update the yt-dlp binary, run npm run updateytdlp or run the setup script (node setup.js)

Usage

const ytdl = require("yt-dlp.js");

let url = "https://youtu.be/q5weS3aY-Qc",
    filename = `${new Date().getTime()}.%(ext)s`,
    args = ["-o", filename, "-x", "--audio-format=mp3", "--restrict-filenames", "--external-downloader=ffmpeg", "--audio-quality=96k"];

ytdl(url, args)
  .then(data => {
    console.log(data);
  })
  .catch(err => {
    console.error(err);
  });

Warning

If it works, it ain't stupid.

I'm a noob. Don't judge me. Pullrequests are very welcome!

About


Languages

Language:JavaScript 100.0%