pytube
Python 3 library for downloading YouTube Videos.
What it is and what it does
pytube is a lightweight, dependency-free Python library for scripting YouTube video downloads. It exposes a simple API to fetch video metadata, select streams by quality or format, and download them to disk, plus a command-line tool for one-off downloads. The library supports both progressive (single-file) and DASH (separate audio/video) streams, playlists, captions in SubRip format, and thumbnail URLs.
The package is dormant—its last release was in May 2023 and the repository has seen no commits since August 2024. YouTube's streaming infrastructure and authentication mechanisms evolve regularly, so users should expect compatibility issues and should verify that the package still works with current YouTube before relying on it in production. The library has no external dependencies, making installation straightforward, but the lack of active maintenance means bug fixes and API adaptations are unlikely.
Use it for:
- Download a single YouTube video at a chosen quality level from a Python script for offline viewing or archival.
- Batch-download an entire YouTube playlist programmatically with custom filtering by resolution or file format.
- Extract and save video captions in SubRip (.srt) format for subtitle use or transcription workflows.
- Retrieve thumbnail images and stream metadata from YouTube videos without downloading the full video file.
- Build a command-line tool or shell script to download videos on demand without writing Python code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pytube downloads YouTube videos and playlists to local files via Python API or command-line interface, with support for multiple stream formats and quality levels.
Yes, if you need a simple, dependency-free way to download YouTube videos and can verify it still works with current YouTube. No, if you require active maintenance, bug fixes, or assurance of compatibility—the package is dormant and YouTube's API changes frequently, so expect breakage without notice. Consider it a working tool for personal use or one-off scripts, not a production dependency.
Install
pytube on PyPI
pip
pip install pytubeuv
uv add pytubepoetry
poetry add pytubeInstalling pytube
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2023-05-07 and no commits since 2024-08-15—so expect compatibility issues with YouTube's evolving API and no active bug fixes.
License in practice
Licensed under The Unlicense (Unlicense), a permissive public-domain-equivalent license that places no restrictions on use, modification, or redistribution.
Quickstart
pip install pytube
from pytube import YouTube
yt = YouTube('https://youtu.be/2lAe1cqCOXo')
yt.streams.first().download()
# Or via CLI:
# pytube https://youtu.be/2lAe1cqCOXo
Requires Python 3.7 or later. YouTube's streaming infrastructure changes frequently; this package is dormant and may break without notice.
Verify before relying
- Whether the package currently works with YouTube's current authentication and stream-extraction mechanisms
- Whether callback functions (on_progress, on_complete) are fully functional in version 15.0.0
- Support status for DASH stream downloads and caption extraction in current YouTube environment
Package facts
| License | The Unlicense (Unlicense) (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,195 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,754,134/month — #2,239 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytube-15.0.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
pytubefixDownloads YouTube videos, playlists, and…
permissive · top 15,000 on PyPI
spotdlspotDL downloads songs from Spotify playlists…
permissive · top 15,000 on PyPI
streamlinkStreamlink extracts video streams from various…
permissive · top 15,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
yt-dlpyt-dlp downloads audio and video from thousands…
permissive · top 5,000 on PyPI
casttubeInteract with YouTube on Chromecast devices by…
permissive · top 15,000 on PyPI
youtube-search-pythonSearch YouTube for videos, channels, and…
permissive · top 15,000 on PyPI
twelvelabsPython SDK for the TwelveLabs video…
unclear · top 15,000 on PyPI
bgutil-ytdlp-pot-providerA yt-dlp plugin that provides proof-of-origin…
copyleft · top 15,000 on PyPI