mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-04 19:36:18 -04:00
Allow passing different arguments to different postprocessors
* Also deprecated --sponskrub-args Closes: https://github.com/ytdl-org/youtube-dl/issues/27593 Eg: `--postprocessor-args "VideoConvertor:-c:v h264_nvenc -preset slow"` Eg: `--postprocessor-args "SponsKrub:-include-selfpromo"` For backward compatibility, `--postprocessor-args args` is equivalent to: `--post-processor-args "sponskrub:" --post-processor-args "default:args"`
This commit is contained in:
@@ -11,6 +11,8 @@ from ..utils import (
|
||||
|
||||
|
||||
class ExecAfterDownloadPP(PostProcessor):
|
||||
PP_NAME = 'Exec'
|
||||
|
||||
def __init__(self, downloader, exec_cmd):
|
||||
super(ExecAfterDownloadPP, self).__init__(downloader)
|
||||
self.exec_cmd = exec_cmd
|
||||
@@ -22,7 +24,7 @@ class ExecAfterDownloadPP(PostProcessor):
|
||||
|
||||
cmd = cmd.replace('{}', compat_shlex_quote(information['filepath']))
|
||||
|
||||
self._downloader.to_screen('[exec] Executing command: %s' % cmd)
|
||||
self.to_screen('Executing command: %s' % cmd)
|
||||
retCode = subprocess.call(encodeArgument(cmd), shell=True)
|
||||
if retCode != 0:
|
||||
raise PostProcessingError(
|
||||
|
Reference in New Issue
Block a user