Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- #
- ##############################################################################
- ### NZBGET POST-PROCESSING SCRIPT ###
- # Save Subtitles so Sonarr doesn't delete them perm!
- ##############################################################################
- ### NZBGET POST-PROCESSING SCRIPT ###
- ##############################################################################
- import os
- import sys
- import shutil
- POSTPROCESS_SUCCESS=93
- nzbfulldir = os.environ.get('NZBPP_DIRECTORY','')
- #installdir = os.environ.get('NZBOP_APPDIR','')
- nzbname = os.environ.get('NZBPP_NZBNAME','')
- for file in os.listdir(nzbfulldir):
- if (file.endswith(".srt")) or (file.endswith(".sub")) or (file.endswith(".idx")):
- print ("[INFO] SUBTITLE FOUND: " + file)
- print ("[INFO] MOVING: " + file)
- source = nzbfulldir + "\\" + file
- print ("[INFO] SOURCE: " + source)
- dest = "X:\SUBTITLE_FOLDER\\" + nzbname
- if not os.path.exists(dest):
- os.makedirs(dest)
- dest = "X:\SUBTITLE_FOLDER\\" + nzbname + "\\" + file
- shutil.move(source,dest)
- sys.exit(POSTPROCESS_SUCCESS)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement