Download YouTube videos to a local file from a Node.js script without any command-line tools
Extract audio-only streams from YouTube videos to process or save separately
Fetch a YouTube video's metadata like title and available formats without downloading the video
Build a server that streams YouTube content directly to users without storing it locally
Active development paused July 2023, use the distube/ytdl-core community fork for ongoing updates and bug fixes.
node-ytdl-core is a Node.js library that downloads YouTube videos from within a JavaScript program. You give it a YouTube URL and it returns a data stream your code can pipe to a file, a media player, or any other destination. It is written in plain JavaScript with no compiled dependencies, and it follows the standard Node.js streaming interface. The library gives you control over what gets downloaded. You can choose quality (highest, lowest, a specific resolution), filter by format (video with audio, video only, audio only), or pick a specific format by its internal YouTube identifier. For cases where you want the audio and video as separate files to merge later, the library also supports downloading each stream independently. Beyond downloading, it can fetch metadata about a video without downloading any of it: title, description, available formats, duration, and similar information. It handles live streams as well as regular videos, though the README notes that seeking to a specific time position within non-live videos is not fully reliable. The README includes a prominent notice that active development was paused in July 2023. The original maintainers are no longer merging pull requests, and the project now relies on community support. For a version that receives ongoing updates, the README points to a community fork called distube/ytdl-core. Installation is via npm (npm install ytdl-core). It runs in any Node.js environment that supports streams, including scripts, servers, and CLI tools. There is no built-in command-line interface, it is purely a library meant to be called from your own JavaScript code.
← fent on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.