Skip to content

πŸ”₯🎢YouTube-Exec: Unleash the Power of YouTube Downloads!

License

Notifications You must be signed in to change notification settings

magneum/youtube-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

69 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“₯πŸŽ₯ YouTube-Exec πŸŽ₯πŸ“₯

⭐️ If you find YouTube-Exec useful, give it a star on GitHub

Unleash the Power of YouTube Downloads! πŸ’ͺπŸ”₯πŸ’»

  • Effortlessly download audio and video content from YouTube. πŸŽ΅πŸŽ¬πŸ’½
  • Utilizes the powerful youtube-dl-exec library for extracting details. πŸ“šπŸ”πŸ’‘
  • Seamless fetching of files using the reliable fluent-ffmpeg library. πŸ”„βš™οΈπŸ”Š
  • Access and download your favorite audio and video treasures from YouTube. πŸŽ‰πŸ”‘πŸ’Ž
  • Say goodbye to limitations and enjoy a world of boundless possibilities. πŸš«πŸŒπŸ”“πŸ’«
License License
Latest Version npm

Installation: πŸ“₯πŸ’»πŸ”§

To embark on your YouTube downloading adventure with YouTube-Exec, you'll need to have Node.js installed on your system. Fear not! The installation process is as easy as a few simple commands:

  • Using yarn or npm or pnpm
$ yarn add youtube-exec
$ npm install youtube-exec
$ pnpm install youtube-exec

Usage (w/o CLI): πŸ–₯οΈπŸ”§πŸ“š

🎡 Download Audio πŸ”Š

To download audio from YouTube, you can use the dlAudio function provided by YouTube-Exec. Here's an example of how to use it:

const { dlAudio } = require("youtube-exec");

// Using async/await
try {
  await dlAudio({
    url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    folder: "downloads", // optional, default: "youtube-exec"
    filename: "filename", // optional, default: video title
    quality: "best", // or "lowest"; default: "best"
  });
  console.log("Audio downloaded successfully! πŸ”ŠπŸŽ‰");
} catch (err) {
  console.error("An error occurred:", err.message);
}

// Using Promises
dlAudio({
  url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  folder: "downloads", // optional, default: "youtube-exec"
  filename: "filename", // optional, default: video title
  quality: "best", // or "lowest"; default: "best"
})
  .then(() => {
    console.log("Audio downloaded successfully! πŸ”ŠπŸŽ‰");
  })
  .catch((err) => {
    console.error("An error occurred:", err.message);
  });
πŸŽ₯πŸ”Š Download Video with Audio πŸŽ₯πŸ”Š

To download videos with audio from YouTube, you can use the dlAudioVideo function provided by YouTube-Exec. Here's an example of how to use it:

const { dlAudioVideo } = require("youtube-exec");

// Using async/await
try {
  await dlAudioVideo({
    url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    folder: "downloads", // optional, default: "youtube-exec"
    filename: "filename", // optional, default: video title
    resolution: 720, // 144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320; default: 480
  });
  console.log("Video downloaded successfully! πŸŽ₯πŸ”ŠπŸŽ‰");
} catch (err) {
  console.error("An error occurred:", err.message);
}

// Using Promises
dlAudioVideo({
  url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  folder: "downloads", // optional, default: "youtube-exec"
  filename: "filename", // optional, default: video title
  resolution: 720, // 144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320; default: 480
})
  .then(() => {
    console.log("Video downloaded successfully! πŸŽ₯πŸ”ŠπŸŽ‰");
  })
  .catch((err) => {
    console.error("An error occurred:", err.message);
  });
πŸŽ₯ Download Video w/o Audio πŸŽ₯

To download videos without audio from YouTube, you can use the dlVideo function provided by YouTube-Exec. Here's an example of how to use it:

const { dlVideo } = require("youtube-exec");

// Using async/await
try {
  await dlVideo({
    url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    folder: "downloads", // optional, default: "youtube-exec"
    filename: "filename", // optional, default: video title
    resolution: 720, // 144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320; default: 480
  });
  console.log("Video downloaded successfully! πŸŽ₯πŸŽ‰");
} catch (err) {
  console.error("An error occurred:", err.message);
}

// Using Promises
dlVideo({
  url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  folder: "downloads", // optional, default: "youtube-exec"
  filename: "filename", // optional, default: video title
  resolution: 720, // 144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320; default: 480
})
  .then(() => {
    console.log("Video downloaded successfully! πŸŽ₯πŸŽ‰");
  })
  .catch((err) => {
    console.error("An error occurred:", err.message);
  });

Usage (with CLI): πŸ–₯οΈπŸ’»πŸ”§πŸ“š

  • Install the package globally:
$ npm install -g youtube-exec # sudo required for global install
Download Audio πŸ”Š (with CLI usage)

The "audio" command allows you to download audio from a YouTube video. It accepts the following options:

  • url: The URL of the YouTube video (required).
  • folder: The output folder name (optional).
  • filename: The output filename (excluding extension) (optional, defaults to video title).
  • quality: The audio quality ("best" or "lowest") (optional, defaults to "best").

Here's an example of how to use the "audio" command:

$ yarn global add youtube-exec # needs to be installed globally
$ youtube-exec audio --url "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --folder "downloads" --filename "filename" --quality "best"
Download Video with Audio πŸŽ₯πŸ”Š (with CLI usage)

The "video-with-audio" command allows you to download video with audio from a YouTube video. It accepts the following options:

  • url: The URL of the YouTube video (required).
  • folder: The output folder name (optional).
  • filename: The output filename (excluding extension) (optional, defaults to video title).
  • resolution: The video resolution (144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320) (optional, defaults to 480).

Here's an example of how to use the "video-with-audio" command:

$ yarn global add youtube-exec # needs to be installed globally
$ youtube-exec video-with-audio --url "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --folder "downloads" --filename "filename" --resolution 720
Download Video without Audio πŸŽ₯πŸ”Š (with CLI usage)

The "video" command allows you to download video without audio from a YouTube video. It accepts the following options:

  • url: The URL of the YouTube video (required).
  • folder: The output folder name (optional).
  • filename: The output filename (excluding extension) (optional, defaults to video title).
  • resolution: The video resolution (144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320) (optional, defaults to 480).

Here's an example of how to use the "video" command:

$ yarn global add youtube-exec # needs to be installed globally
$ youtube-exec video --url "https://www.youtube.com/watch?v=dQw4w9WgXcQ" --folder "downloads" --filename "filename" --resolution 720

Features: 🎯πŸ”₯🌟

  • Extract video and audio details from YouTube effortlessly
  • Download audio files from YouTube videos πŸŽ΅πŸ”Š
  • Download videos with audio from YouTube πŸŽ₯πŸ”Š
  • Choose audio quality (best or lowest) πŸ”ŠπŸ₯‡
  • Choose video resolution (144, 240, 360, 480, 720, 1080, 1440, 2160, or 4320) πŸŽ₯πŸ“Ί
  • Simple and intuitive API πŸš€
  • CLI support for easy downloading πŸ’»βš‘

License: πŸ“œπŸ”

YouTube-Exec is released under the MIT License. Feel free to use, modify, and distribute it as you like. The MIT License grants you the following permissions:

  • βœ… Permission is hereby granted, free of charge, to any person obtaining a copy of the YouTube-Exec software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  • πŸ“‹ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

  • πŸš€ The Software is provided "as is," without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Software or the use or other dealings in the Software.

  • πŸ”— The Software may utilize third-party libraries, including but not limited to youtube-dl-exec and fluent-ffmpeg. Any such libraries are subject to their respective licenses and terms.

  • πŸ”’ Users of the Software acknowledge that the extraction and downloading of audio and video content from YouTube may be subject to legal restrictions and terms of use imposed by YouTube or other relevant entities. It is the responsibility of the users to comply with all applicable laws, regulations, and terms of use when using the Software.

  • πŸ‘₯ The Software is intended for personal and non-commercial use only. Any commercial use of the Software requires explicit permission from the authors.