JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q42435F
  • License MIT

YouTube Audio Downloader

Package Exports

  • node-youtube-audio
  • node-youtube-audio/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-youtube-audio) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

YouTube Audio Downloader

Note

To use this library you must install FFmpeg

Usage

// TypeScript
// import DownloadAudio from "node-youtube-audio";
const DownloadAudio = require("node-youtube-audio");

const url = "https://youtube.com/watch?v=_QW9gBdDU1c";

new DownloadAudio(url)
        .codec("flac")
        .bitRate(1411)
        // Optional. The default is set to 44.1 kHz.
        // .samplingRate(48000)
        // Optional. The default is set to the title of the video.
        // .fileName("myaudioo")
        .outPath("path/to/your/folder")
        .fileExtension("flac")
        .run()
        .then((result) => {
                console.log(result);
        })
        .catch((err) => {
                console.log(err);
        });

Audio Codec

To see the available audio codecs, see the FFmpeg documentation.

The codec I usually use:

  • aac
  • flac
  • pcm_s16le (wav)
  • libvorbis (ogg vorbis)
  • libmp3lame (mp3)
  • alac