Skip to main content
This page provides real-world examples of using yt-dlp as a Python library for various tasks.

Basic Examples

Simple Video Download

Extract Metadata Only

Download with Progress Bar

Audio Extraction

Download MP3 Audio

Extract Audio with Metadata

Playlist Handling

Download Entire Playlist

Get Playlist Information

Download Playlist Items Selectively

Format Selection

Download Specific Quality

List Available Formats

Subtitles and Captions

Download with Subtitles

Download All Available Subtitles

Embed Subtitles in Video

Advanced Use Cases

Download Archive (Skip Downloaded)

Custom Filename Template

Download with Cookies

Rate Limiting

Error Handling and Retries

Batch Download from File

Match Filter (Skip Videos)

Thumbnail Download

Integration Examples

Flask Web API

Command-Line Tool

Usage: