pytubefix
Python3 library for downloading YouTube Videos.
What it is and what it does
Pytubefix is a Python library that wraps YouTube's web interface to download videos, audio, playlists, and channel content without requiring API keys. It offers both synchronous and asynchronous interfaces, allowing you to fetch video metadata (title, views, likes, author, thumbnail), retrieve captions, extract chapters and key moments, and download streams in various resolutions and formats. The library depends on aiohttp for async HTTP operations and nodejs-wheel-binaries for underlying JavaScript execution, and supports Python 3.7 through 3.14.
Typical usage involves instantiating a YouTube object with a video URL, querying available streams, and downloading a specific stream to disk. The library provides convenience methods like get_highest_resolution() and get_audio_only() to simplify common tasks, progress callbacks to track downloads, and OAuth support to handle age-restricted content. For bulk operations, the asynchronous AsyncYouTube interface allows non-blocking downloads and metadata fetches within an event loop.
Use it for:
- Download individual YouTube videos in highest resolution or as audio-only files for offline viewing or archival.
- Batch-download entire playlists or all videos from a channel with minimal code.
- Extract and save video captions or subtitles in SRT format for accessibility or transcription.
- Fetch video metadata (title, view count, likes, author, thumbnail URL) without downloading the full video.
- Build asynchronous download pipelines that handle multiple videos concurrently without blocking.
- Search YouTube and filter results by upload date, duration, or features like 4K or Creative Commons licensing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Downloads YouTube videos, playlists, and channels in multiple formats and resolutions, with support for subtitles, metadata extraction, and asynchronous operations.
Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and installs with low friction. It covers a clear use case (YouTube content download) with both sync and async APIs. Verify that your intended use complies with YouTube's terms of service before deploying in production.
Install
pytubefix on PyPI
pip
pip install pytubefixuv
uv add pytubefixpoetry
poetry add pytubefixInstalling pytubefix
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with recent commits and a stable release cycle; the project shows 1604 stars and receives regular updates.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects.
Quickstart
pip install pytubefix
from pytubefix import YouTube
from pytubefix.cli import on_progress
yt = YouTube('https://www.youtube.com/watch?v=...', on_progress_callback=on_progress)
stream = yt.streams.get_highest_resolution()
stream.download()
Requires nodejs-wheel-binaries as a runtime dependency; YouTube may block or rate-limit automated downloads depending on usage patterns and account status.
Verify before relying
- Whether YouTube's terms of service permit automated video downloads for your intended use case
- Whether OAuth authentication actually bypasses age-restricted content restrictions or merely handles authentication
- Performance characteristics of AsyncYouTube relative to synchronous YouTube for bulk downloads
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — aiohttp, nodejs-wheel-binaries |
| Maintenance | actively maintained — 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 322,348/month — #7,614 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytubefix-10.11.0-py3-none-any.whl
Keywords: youtube, download, video, stream
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pytubepytube downloads YouTube videos and playlists…
permissive · top 5,000 on PyPI
youtube-transcript-apiFetches transcripts and subtitles from YouTube…
permissive · top 1,000 on PyPI
youtube_dlCommand-line tool to download videos from…
permissive · top 15,000 on PyPI
subliminalSubliminal downloads subtitles for video files…
permissive · top 15,000 on PyPI
spotdlspotDL downloads songs from Spotify playlists…
permissive · top 15,000 on PyPI
micawberExtracts rich metadata (title, author,…
unclear · top 15,000 on PyPI
streamlinkStreamlink extracts video streams from various…
permissive · top 15,000 on PyPI
sphinxcontrib-youtubeAdds Sphinx directives to embed YouTube, Vimeo,…
permissive · top 15,000 on PyPI
yt-dlp-ejsProvides external JavaScript execution support…
permissive · top 5,000 on PyPI
python-youtubeA Python wrapper for the YouTube Data API V3…
permissive · top 15,000 on PyPI