Skip to content

About

A simple Python CLI to download YouTube videos (MP4) or audio (MP3), choose video quality, and download subtitles using yt-dlp.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Downloader

A simple Python script that downloads YouTube videos or audio using yt-dlp.

License Python Stars Last Commit

Disclaimer

This tool relies on YouTube, which may change or restrict access at any time. Use it at your own risk, downloading content may also be subject to YouTube's Terms of Service depending on your use case.

Features

  • Download videos as MP4
  • Download audio as MP3
  • Choose the video quality before downloading
  • Download subtitles (manual or automatic)

Requirements

  • Python 3.10+
  • FFmpeg
  • yt-dlp

Install yt-dlp

pip install yt-dlp

Install FFmpeg (Windows)

winget install FFmpeg

After installation, restart your terminal if needed.


Usage

python ytdl.py <youtube_url> <format>

Download a video

python ytdl.py "https://youtu.be/VIDEO_ID" mp4

The script will:

  1. Display all available video qualities.
  2. Ask which quality you want.
  3. Ask whether you want subtitles.
  4. Download and merge the video into an MP4 file.

Download audio

python ytdl.py "https://youtu.be/VIDEO_ID" mp3

The script downloads the best available audio and converts it to MP3.


Output

Downloaded files are saved in the same directory as the script.

Examples:

My Video.mp4
My Song.mp3
My Video.en.vtt

Notes

  • If subtitles are available, you can choose one or more language codes (for example: en, fr, ar).
  • Press Enter when asked for a quality to download the best available quality.
  • Press Enter when asked for subtitle languages to download all available subtitle languages.
  • Some videos may not provide subtitles or may have automatic captions only.
  • If YouTube temporarily rate-limits subtitle downloads (HTTP 429), wait a while and try again.

Project Status

This project is currently under development.

Current Features

  • ✅ Download YouTube videos as MP4
  • ✅ Download YouTube audio as MP3
  • ✅ Interactive video quality selection
  • ✅ Automatic video/audio merging with FFmpeg
  • 🚧 Subtitle download support (work in progress)

Note: Video and audio downloads are fully functional. Subtitle downloading is still being improved and may not work correctly for every video due to YouTube restrictions or rate limits.


Roadmap

Completed

  • MP4 video downloads
  • MP3 audio extraction
  • Quality selection
  • FFmpeg integration
  • Interactive command-line interface

In Progress

  • Reliable subtitle downloading
  • Better subtitle language selection
  • Improved error handling

Planned

  • Playlist support
  • Download progress improvements
  • Batch downloads
  • Custom output directory
  • Download thumbnails
  • Metadata embedding
  • Configuration file support

License

This project is open source under the MIT License.

About

A simple Python CLI to download YouTube videos (MP4) or audio (MP3), choose video quality, and download subtitles using yt-dlp.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages