Last active
November 16, 2015 18:15
-
-
Save hazcod/dbe24a091170948e64e4 to your computer and use it in GitHub Desktop.
Post-process file for CouchPotato (custom_plugins/__init__.py)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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