Skip to content

Instantly share code, notes, and snippets.

@hazcod
Last active November 16, 2015 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hazcod/dbe24a091170948e64e4 to your computer and use it in GitHub Desktop.
Save hazcod/dbe24a091170948e64e4 to your computer and use it in GitHub Desktop.
Post-process file for CouchPotato (custom_plugins/__init__.py)
from os import system, path, makedirs
import sys
def autoload():
move_to="/home/media/data/uploadme/movies/"
arr=sys.argv[2].split('/')
moviename=arr[6]
if not path.exists(move_to + moviename):
makedirs(move_to + moviename)
system("/home/media/applications/automator/manual.py -a -i \"" + sys.argv[2] + "\" -imdb " + sys.argv[1] + " --moveto \"" + move_to + moviename + "\"")
system("find \"" + move_to + moviename + "\" -type f -exec rename -v -f 's/\(\d\)+//g' {} \;")
# Don't remove this file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment