πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

youtube-downloader-cc-api

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

youtube-downloader-cc-api

A simple wrapper for the Youtube Downloader CC API for downloading YouTube videos as MP3 or MP4.

1.0.4
latest
npm
Version published
Weekly downloads
18
-37.93%
Maintainers
1
Weekly downloads
Β 
Created
Source

🎬 YouTube Downloader CC API

A simple and easy-to-use Node.js package that allows you to download YouTube videos as MP3 or MP4 and updated in March 21 2025. Built and maintained by Jonell Magallanes.

πŸ”— Admin: Jonell Magallanes

πŸ“₯ Installation

First, install the package using npm:

npm install youtube-downloader-cc-api

This will automatically install all required dependencies.

✨ Features

βœ… Download YouTube videos as MP3 (audio) or MP4 (video)
βœ… Choose between two response types:

  • "stream" β†’ Returns a JSON response with a download link
  • "direct" β†’ Automatically downloads the file locally
    βœ… Fast and simple API for developers

πŸš€ How to Use

1️⃣ Import the Library

Before using the downloader, you need to import the function:

const { getDownloadDetails } = require("youtube-downloader-cc-api");

2️⃣ Fetch Download Details

Now, call the function with three parameters:

  • YouTube URL β†’ The video you want to download
  • Type β†’ Choose "mp3" for audio or "mp4" for video
  • Response Type β†’ "stream" for JSON output or "direct" to auto-download

If you only need the download link, use the "stream" response type:

const { getDownloadDetails } = require("youtube-downloader-cc-api");

(async () => {
  try {
    const url = "https://youtu.be/Rb1HSnuR8WE"; // Replace with your YouTube link
    const type = "mp3"; // Choose "mp3" or "mp4"
    const responseType = "stream"; // Get the JSON response (link only)

    const response = await getDownloadDetails(url, type, responseType);
    console.log("Download Details:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
})();

πŸ“ Output (Stream Response)

If responseType is "stream", the function returns a JSON object like this:

{
  "url": "https://youtu.be/Rb1HSnuR8WE",
  "download": "https://yt-downloader-ccprojects-production.up.railway.app/download/1737550613.mp3",
  "title": "Family Guy Funny Spelling",
  "response": "Time Response: Wed Jan 22 12:56:57 2025",
  "author": "Jonell Hutchin Magallanes"
}

πŸ”Ή Best for: Developers who want to display the download link to users instead of downloading the file directly.

πŸŽ₯ Example: Auto-Download (Direct Response)

If you want to automatically download the video or audio file, use the "direct" response type:

const { getDownloadDetails } = require("youtube-downloader-cc-api");

(async () => {
  try {
    const url = "https://youtu.be/Rb1HSnuR8WE"; // Replace with your YouTube link
    const type = "mp4"; // Choose "mp3" or "mp4"
    const responseType = "direct"; // Auto-download the file

    const response = await getDownloadDetails(url, type, responseType);
    console.log(`βœ… File saved at: ${response.path}`);
  } catch (error) {
    console.error("Error:", error.message);
  }
})();

πŸ“‚ Output (Direct Download)

If responseType is "direct", the function will automatically download the file to your local machine:

Downloading [####################] 100% | 8.6MB/8.6MB bytes
βœ… Download complete!
File saved at: /your/path/downloaded_file.mp4

πŸ”Ή Best for: Users who want to instantly download the video/audio without extra steps.

πŸ“œ API Reference

βœ… getDownloadDetails(url, type, responseType)

This function fetches the download details for a given YouTube video.

ParameterTypeRequiredDescription
urlStringYesThe YouTube video URL.
typeStringYesChoose "mp3" for audio or "mp4" for video.
responseTypeStringYes"stream" (get link as JSON) or "direct" (auto-download).

πŸ› οΈ Install Dependencies (Optional)

The required dependencies are automatically installed, but if needed, you can manually install them:

npm install axios cli-progress fs path

🎯 Example Output in Node.js

When you run the example code, you will see output like this:

For stream response type:

{
  "url": "https://youtu.be/Rb1HSnuR8WE",
  "download": "https://yt-downloader-ccprojects-production.up.railway.app/download/1737550613.mp3",
  "title": "Family Guy Funny Spelling",
  "response": "Time Response: Wed Jan 22 12:56:57 2025",
  "author": "Jonell Hutchin Magallanes"
}

For direct response type:

Downloading [####################] 100% | 8.6MB/8.6MB bytes
βœ… Download complete!
File saved at: /your/path/downloaded_file.mp4

🌐 Main Server of Youtube DL

This Main Server of Youtube DL CC visit https://jonell01-youtube-dl-ccapi-hutchin.hf.space/ for more info

πŸŽ‰ Conclusion

The YouTube Downloader CC API makes it easy and efficient to download YouTube videos in MP3 or MP4 format. Whether you want to get a download link or automatically save the file, this library is built to be simple and developer-friendly.

πŸš€ Start using it today and integrate YouTube downloads into your projects!

πŸ’¬ Join Our Community

Join the Chatbot Community Group on Facebook to connect with other developers:
πŸ”— Chatbot Community

πŸŽ–οΈ Special Thanks:
πŸ’‘ Salamat sa CCPRAKJIK 19 na commands ko πŸ€‘

Keywords

youtube

FAQs

Package last updated on 24 Mar 2025

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