From ebed8b373214316fce489fe21629fcef91bb9af3 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 2 Jan 2022 16:23:20 +0530 Subject: Add more post-processing stages playlist = After entire playlist after_video = After downloading all formats of a video --- ytdlp_plugins/postprocessor/sample.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ytdlp_plugins/postprocessor/sample.py') diff --git a/ytdlp_plugins/postprocessor/sample.py b/ytdlp_plugins/postprocessor/sample.py index 6891280d5..551c4bfff 100644 --- a/ytdlp_plugins/postprocessor/sample.py +++ b/ytdlp_plugins/postprocessor/sample.py @@ -14,8 +14,10 @@ class SamplePluginPP(PostProcessor): # ℹ️ See docstring of yt_dlp.postprocessor.common.PostProcessor.run def run(self, info): - filepath = info.get('filepath') - if filepath: # PP was called after download (default) + if info.get('_type', 'video') != 'video': # PP was called for playlist + self.to_screen(f'Post-processing playlist {info.get("id")!r} with {self._kwargs}') + elif info.get('filepath'): # PP was called after download (default) + filepath = info.get('filepath') self.to_screen(f'Post-processed {filepath!r} with {self._kwargs}') else: # PP was called before actual download filepath = info.get('_filename') -- cgit v1.2.3