From 960ef979cd9229e86e0854a9d18e7b9b9b184457 Mon Sep 17 00:00:00 2001 From: joncody Date: Sat, 7 Apr 2018 17:44:07 -0700 Subject: [PATCH] . --- youtube_dl/postprocessor/execafterdownload.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/postprocessor/execafterdownload.py b/youtube_dl/postprocessor/execafterdownload.py index 64dabe790..33ddd16db 100644 --- a/youtube_dl/postprocessor/execafterdownload.py +++ b/youtube_dl/postprocessor/execafterdownload.py @@ -20,7 +20,11 @@ class ExecAfterDownloadPP(PostProcessor): if '{}' not in cmd: cmd += ' {}' + # expose the playlist_index and title variables to exec argument + # youtube-dl -x -o "%(playlist_index)s - %(title)s.%(ext)s" --exec "id3v2 -T {playlist_index} -t {title} {}" PLAYLIST_ID cmd = cmd.replace('{}', compat_shlex_quote(information['filepath'])) + cmd = cmd.replace('{title}', compat_shlex_quote(information['title'])) + cmd = cmd.replace('{playlist_index}', str(information['playlist_index'])) self._downloader.to_screen('[exec] Executing command: %s' % cmd) retCode = subprocess.call(encodeArgument(cmd), shell=True)