.
This commit is contained in:
parent
20584cede3
commit
e078f7d468
@ -18,14 +18,16 @@ class ExecAfterDownloadPP(PostProcessor):
|
||||
|
||||
def run(self, information):
|
||||
cmd = self.exec_cmd
|
||||
|
||||
# expose info to exec argument
|
||||
# youtube-dl -x -o "%(playlist_index)s - %(title)s.%(ext)s" --exec "id3v2 -T %(playlist_index)s -t %(title)s %(filepath)s" PLAYLIST_ID
|
||||
str_types = (str) if sys.version_info.major > 2 else (str, unicode)
|
||||
info = {}
|
||||
|
||||
if '%(filepath)s' not in cmd:
|
||||
cmd += ' %(filepath)s'
|
||||
|
||||
for key in information:
|
||||
value = information[key]
|
||||
info[key] = compat_shlex_quote(value) if isinstance(value, str_types) else value
|
||||
|
||||
cmd = cmd % info
|
||||
|
||||
self._downloader.to_screen('[exec] Executing command: %s' % cmd)
|
||||
|
Loading…
x
Reference in New Issue
Block a user