Socket
Book a DemoInstallSign in
Socket

@cxstin/ytdl

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cxstin/ytdl

## An easy and quick way to download youtube videos/playlists

0.0.4
latest
npmnpm
Version published
Maintainers
1
Created
Source

Youtube Downloader

An easy and quick way to download youtube videos/playlists

Installation

- First you may need to install ffmpeg.

npm i @cxstin/ytdl

Usage

Downloading Videos

const ytdl = require("@cxstin/ytdl");

const yt = ytdl()

// Download the video as an mp4 file with video and audio.
// The video quality will be better than the audio since we use "highestvideo" as our quality parameter
yt.video(
  "https://www.youtube.com/watch?v=Hcoe-AHk4uE",
  "videoandaudio",
  "highestvideo"
);

Downloading Playlists

- THE PLAYLIST YOU ARE DOWNLOADING NEEDS TO BE EITHER PUBLIC OR UNLISTED, IT WILL NOT WORK IF ITS PRIVATE

const ytdl = require("@cxstin/ytdl");

const yt = ytdl()

// This will create a new directory with the playlist's name and will download all the videos it contains into that directory.
yt.playlist(
  "https://www.youtube.com/playlist?list=PL2xsJowpDh_Czfwzj6DU7XHOYgQ-g_-kn",
  "videoandaudio",
  "highestvideo"
);

FAQs

Package last updated on 05 Aug 2023

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.