What is a Post-Processor?
A post-processor is a component that:- Runs after a video has been downloaded
- Modifies, converts, or enhances the downloaded file
- Can be chained with other post-processors
- Returns information about processed files
PostProcessor base class.
Using Post-Processors
Via Options Dictionary
The most common way to use post-processors is through thepostprocessors option:
Via add_post_processor()
You can also add post-processors programmatically:PostProcessor Base Class
All post-processors inherit from this base class.Constructor
YoutubeDL
The YoutubeDL instance that will use this post-processor
Main Method: run()
Every post-processor must implement therun() method:
dict
required
Dictionary containing video information and the ‘filepath’ key pointing to the downloaded file
tuple[list, dict]
Returns a tuple of (files_to_delete, updated_information)
Utility Methods
method
Print a message to the screen
method
Report a warning message
method
Write a debug message
method
Get a parameter from the YoutubeDL instance
When to Run Post-Processors
Post-processors can run at different stages of the download process:string
Before any processing (very early)
string
After video is filtered but before download
string
Just before downloading
string
default:"true"
After download completes (default)
string
After file is moved to final location
string
After all post-processors for a video
string
After entire playlist is processed