Skip to content

hetari/pyutube

Repository files navigation

πŸ“Ή Pyutube - The Simplest YouTube Downloader CLI

Enjoying my project? Please show your appreciation by starring it on GitHub! ⭐

Ask in DeepWiki Version Downloads Downloads per Month Downloads per Week

Note

Pyutube is built on top of pytubefix. If downloads stop working, update it first:

pip install --upgrade pytubefix
Pyutube

Note

Have a feature request or bug report? tell me

Why Pyutube?

Pyutube is a small CLI wrapper around pytubefix. It supports videos, shorts, audio-only downloads, and playlists with a simple prompt-driven flow. Audio downloads are saved as WAV by default, with an optional MP3 conversion flag.

πŸ› οΈ Installation

Make sure Python is installed:

python --version

If you are developing locally, clone the repository and install the dependencies:

pip install -r requirements.txt -r requirements-dev.txt

To install the published package:

pip install pyutube

Tip

If the installation or update does not work, try running the command with the pip install pyutube --break-system-packages flag.

Then run pyutube --help to confirm the CLI is available.

πŸ“ˆ Upgrade

To upgrade the installed package:

pip install --upgrade pyutube

Tip

If the installation or update does not work, try running the command with the pip install --upgrade pyutube --break-system-packages flag.

πŸš€ Run It

Use either of these commands to view the CLI help:

pyutube --help
python -m pyutube --help

Download a video, short, or playlist with:

pyutube "YOUTUBE_LINK"
pyutube "YOUTUBE_LINK" "/path/to/save"

Common examples:

pyutube "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
pyutube "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -a
pyutube "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -a --mp3
pyutube "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -f
pyutube "https://www.youtube.com/playlist?list=PLAYLIST_ID"

Note

The URL is required. The path is optional and defaults to the current working directory.

πŸ‘¨β€πŸ’» Usage

Arguments

Arguments Description
URL The YouTube URL or video ID. This argument is required.
PATH The path to save the video. Defaults to the current working directory. [Optional]

Options

Option Description
-v or --version Display the current version number.
-a or --audio Download audio only as WAV, skipping prompts.
--mp3 Convert audio downloads to MP3.
-f or --footage Download video only, skipping prompts.

πŸ§ͺ Test And Quality

Run these commands to check code health locally:

python -m compileall pyutube
pytest pyutube/tests -q
ruff check pyutube
mypy pyutube
coverage run -m pytest pyutube/tests -q
coverage report

The repo also includes a short checklist in QUALITY.md.

πŸ•΅οΈβ€β™‚οΈ Examples

More examples are in EXAMPLES.md.

πŸ₯° Contributing

Pull requests are welcome. For larger changes, open an issue first and follow the contributing guidelines.

πŸ“Ž License

This project is licensed under the MIT License.

πŸ“Έ Screenshots

Download a video to a specific location

Download video with specify the save location

Choose what type to download

Chose what type you want to download

Choose a resolution when downloading video

Chose what resolution you want to download

Select playlist items to download

If you download a playlist, you can choose what video you want to download, or even all of them

Need help? Run pyutube --help

image5

⏳ Todo List

  • Notification System
  • Auto Update package if new version available
  • Support Optional Numbering for Downloaded Playlist Videos
  • Improve code health
  • Support downloading sounds (WAV by default, MP3 optional)
  • Support Subtitles Download
  • Support setting for downloading folder
  • Download Thumbnails with Videos and Audio