]>
jfr.im git - yt-dlp.git/blob - youtube_dlc/postprocessor/execafterdownload.py
1 from __future__
import unicode_literals
5 from .common
import PostProcessor
6 from ..compat
import compat_shlex_quote
13 class ExecAfterDownloadPP(PostProcessor
):
15 def __init__(self
, downloader
, exec_cmd
):
16 super(ExecAfterDownloadPP
, self
).__init
__(downloader
)
17 self
.exec_cmd
= exec_cmd
23 def run(self
, information
):
28 cmd
= cmd
.replace('{}', compat_shlex_quote(information
['filepath']))
30 self
.to_screen('Executing command: %s' % cmd
)
31 retCode
= subprocess
.call(encodeArgument(cmd
), shell
=True)
33 raise PostProcessingError(
34 'Command returned error code %d' % retCode
)
36 return [], information