mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 12:59:36 -07:00
Correct pass in of transmission variables
This commit is contained in:
parent
649d9dcd4d
commit
887b067227
1 changed files with 13 additions and 9 deletions
|
@ -44,7 +44,11 @@ if len(sys.argv) == 4:
|
||||||
Name = sys.argv[2] ## %N -- Example output: My.Series.S01E01.720p.HDTV.x264-2HD
|
Name = sys.argv[2] ## %N -- Example output: My.Series.S01E01.720p.HDTV.x264-2HD
|
||||||
Category = sys.argv[3] ## %L -- Example output: tvseries ## This is the label in uTorrent
|
Category = sys.argv[3] ## %L -- Example output: tvseries ## This is the label in uTorrent
|
||||||
|
|
||||||
else len(sys.argv) == 7:
|
elif len(sys.argv) > 1: #Doesn't match Transmission (1) or uTorrent (4).
|
||||||
|
print "The number of arguments passed is", len(sys.argv), "unable to determin the arguments to use, Exiting"
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
|
else:
|
||||||
##test for Transmission here.
|
##test for Transmission here.
|
||||||
#TR_APP_VERSION
|
#TR_APP_VERSION
|
||||||
#TR_TIME_LOCALTIME
|
#TR_TIME_LOCALTIME
|
||||||
|
@ -52,15 +56,15 @@ else len(sys.argv) == 7:
|
||||||
#TR_TORRENT_HASH
|
#TR_TORRENT_HASH
|
||||||
#TR_TORRENT_ID
|
#TR_TORRENT_ID
|
||||||
#TR_TORRENT_NAME
|
#TR_TORRENT_NAME
|
||||||
print "script called from Transmission"
|
try:
|
||||||
Directory = sys.argv[3]
|
Directory = os.getenv('TR_TORRENT_DIR')
|
||||||
Name = sys.argv[6]
|
Name = os.getenv('TR_TORRENT_NAME')
|
||||||
|
print "script called from Transmission"
|
||||||
|
except:
|
||||||
|
print "There was a problem loading variables from Transmission", "Exiting"
|
||||||
|
sys.exit(-1)
|
||||||
Category = os.path.basename(os.path.normpath(Directory)) #We assume the last directory is the category for now.
|
Category = os.path.basename(os.path.normpath(Directory)) #We assume the last directory is the category for now.
|
||||||
|
|
||||||
else:
|
|
||||||
print "The number of arguments passed is", len(sys.argv), "unable to determin the arguments to use, Exiting
|
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
if not Category:
|
if not Category:
|
||||||
Category = os.path.basename(os.path.normpath(Directory)) #Test for blackhole sub-directory.
|
Category = os.path.basename(os.path.normpath(Directory)) #Test for blackhole sub-directory.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue