mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 06:13:19 -07:00
Updated TorrentToMedia for braid
This commit is contained in:
parent
bf80d6ae5f
commit
b23a21e178
1 changed files with 21 additions and 14 deletions
|
@ -1,12 +1,18 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
#System imports
|
||||
import ConfigParser
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
|
||||
# Custom imports
|
||||
import linktastic.linktastic as linktastic
|
||||
import autoProcessMovie
|
||||
import autoProcessTV
|
||||
import sys, os, ConfigParser, shutil
|
||||
import linktastic
|
||||
|
||||
from nzbToMediaEnv import *
|
||||
|
||||
|
||||
def removeEmptyFolders(path):
|
||||
if not os.path.isdir(path):
|
||||
return
|
||||
|
@ -25,9 +31,10 @@ def removeEmptyFolders(path):
|
|||
print "INFO: Removing empty folder: %s" % (path)
|
||||
os.rmdir(path)
|
||||
|
||||
old_stdout = sys.stdout #backup the default stdout
|
||||
log_file = open(os.path.join(os.path.dirname(sys.argv[0]), "postprocess.log"),"a+")
|
||||
sys.stdout = log_file #create a local log file, and direct all "print" to the log.
|
||||
|
||||
old_stdout = sys.stdout # backup the default stdout
|
||||
log_file = open(os.path.join(os.path.dirname(sys.argv[0]), "postprocess.log"), "a+")
|
||||
sys.stdout = log_file # create a local log file, and direct all "print" to the log.
|
||||
print "INFO: TorrentToMedia %s" % VERSION
|
||||
if len(sys.argv) == 4:
|
||||
##You can use the following parameters (UTORRENT):
|
||||
|
@ -84,7 +91,7 @@ else:
|
|||
except:
|
||||
print "Error: There was a problem loading variables from Transmission", "Exiting"
|
||||
sys.exit(-1)
|
||||
Category = '' #We dont have a category, so assume the last directory is the category for now.
|
||||
Category = '' # We dont have a category, so assume the last directory is the category for now.
|
||||
|
||||
print "DEBUG: Received Directory: %s" % (Directory)
|
||||
print "DEBUG: Received Torrent Name: %s" % (Name)
|
||||
|
@ -113,7 +120,7 @@ Movie_Cat = config.get("CouchPotato", "category")
|
|||
useLink = int(config.get("Torrent", "uselink"))
|
||||
extractionTool = config.get("Torrent", "extractiontool")
|
||||
|
||||
DirBase = os.path.split(os.path.normpath(Directory)) #Test for blackhole sub-directory.
|
||||
DirBase = os.path.split(os.path.normpath(Directory)) # Test for blackhole sub-directory.
|
||||
if DirBase[1] == Name:
|
||||
print "INFO: Files appear to be in their own directory"
|
||||
DirBase2 = os.path.split(os.path.normpath(DirBase[0]))
|
||||
|
@ -146,7 +153,7 @@ if Category == Movie_Cat:
|
|||
elif Category == TV_Cat:
|
||||
destination = os.path.join(TV_dest, Name)
|
||||
else:
|
||||
print "INFO: Category of %s does not match either %s or %s: Exiting" %(Category, Movie_Cat, TV_Cat)
|
||||
print "INFO: Category of %s does not match either %s or %s: Exiting" % (Category, Movie_Cat, TV_Cat)
|
||||
sys.exit(-1)
|
||||
|
||||
test = ['.zip', '.rar', '.7z', '.gz', '.bz', '.tar', '.arj']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue