Pyutube is a small CLI for downloading YouTube videos, shorts, audio, and playlists.
Note
Have a feature request or bug report? tell me
pip install pyutubeFor local development:
pip install -e ".[dev]"pyutube "<youtube-url>"
pyutube "<youtube-url>" "/path/to/save"
pyutube "<youtube-url>" -a
pyutube "<youtube-url>" -f
pyutube "<playlist-url>"
pyutube "<youtube-url>" -- --ignore-errors --write-info-jsonShort version:
URLis required.PATHis optional and defaults to the current directory.-adownloads audio only (as MP3).-fdownloads video only.- Playlist URLs first show a selection menu so you can choose specific items or download all.
- Anything after
--is forwarded toyt-dlp.
Important
Facing Sign in to confirm you’re not a bot, HTTP Error 403: Forbidden, or The page needs to be reloaded?
YouTube enforces bot-detection and client-verification challenges. Pass your browser cookies and enable the challenge solver by forwarding options after --:
pyutube "<youtube-url>" -- --cookies-from-browser chrome --remote-components ejs:github- Replace
chromewith your preferred browser (e.g.,firefox,edge,brave). - When downloading single videos, ensure personal playlist parameters like
?list=LLare removed from the URL.
Check the CLI help:
pyutube --help
python -m pyutube --help- EXAMPLES.md for quick command examples.
- QUALITY.md for local checks.
- CONTRIBUTING.md for contribution rules.
MIT. See LICENSE.