What is an Extractor?
An extractor is a class that:- Determines if it can handle a given URL
- Extracts video metadata (title, description, formats, etc.)
- Provides download URLs for the video content
InfoExtractor base class.
Using Extractors
List Available Extractors
Get a Specific Extractor
Force a Specific Extractor
InfoExtractor Base Class
All extractors inherit from theInfoExtractor class, which provides common functionality.
Key Attributes
string
The extractor’s unique identifier (e.g., ‘youtube’, ‘vimeo’)
string
Human-readable description of the extractor
string
Regular expression pattern matching URLs this extractor can handle
boolean
default:"true"
Whether the extractor is currently working
int
Age limit for content from this extractor
Common Methods
suitable()
Check if the extractor can handle a URL.working()
Check if the extractor is currently working.Information Dictionary Format
Extractors return information dictionaries with standardized fields:Required Fields
string
required
Unique video identifier
string
required
Video title (empty string if unavailable, not None)
Format Information
list[dict]
List of available formats, ordered from worst to best quality. Each format dict contains:
url: Media URLformat_id: Format identifierext: File extensionwidth,height: Video dimensionstbr,abr,vbr: Bitratesacodec,vcodec: Codec namesfilesize: File size in bytes
Optional Metadata Fields
string
Video description
string
Name of the video uploader
string
Uploader’s unique identifier
string
URL to uploader’s profile
int
Video duration in seconds
int
Number of views
int
Number of likes
string
Upload date in YYYYMMDD format
int
Unix timestamp of upload time
list[dict]
List of thumbnail dictionaries with ‘url’, ‘width’, ‘height’
dict
Dictionary mapping language codes to lists of subtitle format dicts
list[string]
List of video categories
list[string]
List of tags
Working with Playlists
Some extractors handle playlists or channels. These return a different structure:string
Type of result: ‘video’, ‘playlist’, ‘multi_video’, or ‘url’
list[dict]
For playlists: list of video info dictionaries
string
Title of the playlist
int
Total number of videos in playlist
Extractor Arguments
Some extractors accept additional arguments to customize their behavior:Common Extractor Examples
YouTube
Generic Extractor
The generic extractor can handle many sites by detecting embedded videos:List Supported Sites
Extractor Plugins
You can create custom extractors as plugins. Place them in:~/.yt-dlp/plugins/extractor/${XDG_CONFIG_HOME}/yt-dlp/plugins/extractor/