skillfed

pytube

Python 3 library for downloading YouTube Videos.

pytube v15.0.0 4.8M downloads/30d#2,239 on PyPI13,170
Permissive license The Unlicense (Unlicense) DORMANT released

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 pytube

uv

uv add pytube

poetry

poetry add pytube

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: The Unlicense (Unlicense)Natural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Multimedia :: VideoTopic :: Software Development :: Libraries :: Python ModulesTopic :: TerminalsTopic :: Utilities

Tags

youtube video downloader pythondownload youtube videos programmaticallyyoutube playlist downloaderpython youtube stream extractorcli youtube video downloadyoutube video quality selectionbatch download youtube videos
video-downloadyoutubecli-tool

More Python Modules packages