Skip to content

YouTube Video Downloader coded in TypeScript (NO MP3 SUPPORT YET!)

License

Notifications You must be signed in to change notification settings

cptcr/yt-downloader-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

YouTube Downloader in TypeScript

This is a command-line tool to download YouTube videos in various formats (MP3, MP4, WEBM) using TypeScript. The tool leverages ytdl-core for fetching YouTube video data and readline-sync for interactive command-line input.

Prerequisites

  • Node.js installed on your system (version 12 or higher).
  • npm (Node Package Manager) should be installed.
  • TypeScript globally installed (npm install -g typescript).

Setup Instructions

  1. Clone the Repository

    git clone https://github.com/cptcr/yt-downloader-ts/
    cd https://github.com/cptcr/yt-downloader-ts/
  2. Install Dependencies

    Install the required dependencies using npm:

    npm install
  3. Compile TypeScript to JavaScript

    Compile the TypeScript code to JavaScript:

    npx tsc

    This will generate the compiled JavaScript files in the same directory.

  4. Run the YouTube Downloader

    After compiling, you can run the script using Node.js:

    node <compiled-file-name>.js

    Replace <compiled-file-name> with the actual compiled JavaScript file name.

How to Use

  1. Enter the YouTube video URL you want to download.
  2. Confirm if you want to download the video after seeing its title.
  3. Choose the format you want to download (MP3, MP4, WEBM).
  4. Select the desired quality for the download.
  5. Wait for the download to complete. The file will be saved in the same directory.

Notes

  • Ensure you have a stable internet connection for downloading videos.
  • The downloaded files will be saved with a timestamp to avoid overwriting existing files.

Troubleshooting

  • If you encounter issues while downloading, ensure the YouTube URL is valid.
  • For permission errors, make sure you have the appropriate write permissions in the directory where you are running the script.
  • If you receive "No available formats found," the video might have restricted formats. Try another video.

License

This project is licensed under the MIT License.

Acknowledgments

Enjoy downloading YouTube videos!

About

YouTube Video Downloader coded in TypeScript (NO MP3 SUPPORT YET!)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published