diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 92e2ab96..281d229f 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -278,12 +278,15 @@ def external_script(outputDestination): if param == "FN": command.append(file) continue - if param == "FP": + elif param == "FP": command.append(filePath) continue - if param == "DN": + elif param == "DN": command.append(dirpath) continue + else: + command.append(param) + continue Logger.info("Running script %s on file %s.", command, filePath) try: p = Popen(command) diff --git a/autoProcessMedia.cfg.sample b/autoProcessMedia.cfg.sample index c2897fdc..9d5cc4a0 100644 --- a/autoProcessMedia.cfg.sample +++ b/autoProcessMedia.cfg.sample @@ -136,8 +136,8 @@ user_script_mediaExtensions = .mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg #Specify the path of the script user_script_path = /media/test/script/script.sh #Specify the argument(s) passed to script, comma separated in order. -#for example FP,FN,DN for file path (absolute file name with path), file anme, absolute directory name (with path). -#So the result is /media/test/script/script.sh FP FN DN +#for example FP,FN,DN for file path (absolute file name with path), file name, absolute directory name (with path). +#So the result is /media/test/script/script.sh FP FN DN. Add other arguments as needed eg -f, -r user_script_param = FN #Specify the successcodes returned by the user script as a comma separated list. Linux default is 0 user_script_successCodes = 0