diff --git a/OpenSubtitlesDownload.py b/OpenSubtitlesDownload.py index e6e8ea6..ecc2b11 100755 --- a/OpenSubtitlesDownload.py +++ b/OpenSubtitlesDownload.py @@ -141,6 +141,11 @@ opt_selection_rating = 'off' opt_selection_count = 'off' +# ==== HOOK ==================================================================== + +# Use a secondary tool on the subtitles file after a successful download? +custom_command = "" + # ==== Check file path & type ================================================== def checkFileValidity(path): @@ -1042,8 +1047,10 @@ def downloadSubtitles(USER_TOKEN, subURL, subPath): superPrint("error", "Subtitling error!", f"An error occurred while downloading or writing {subLangName} subtitles for {videoTitle}.") sys.exit(2) - ## HOOK # Use a secondary tool after a successful download? - #process_subtitlesDownload = subprocess.call("(custom_command" + " " + subPath + ") 2>&1", shell=True) + ## HOOK # Use a secondary tool on the subtitles file after a successful download? + if process_subtitlesDownload == 0 and len(custom_command) > 0: + subPathEscaped = escapePath_wget(subPath) + process_subtitlesDownload = subprocess.call(f'{custom_command} "{subPathEscaped}"', shell=True) ## Print a message if no subtitles have been found, for any of the languages if languageCount_results == 0: