From 2213279086a9998721315a09e179010541f8e68d Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 19 Feb 2013 14:28:54 -0800 Subject: [PATCH] utorrent not passing category if doesn't exist. --- TorrentToMedia.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index e3b3da77..ecc2ec42 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -263,6 +263,12 @@ if len(sys.argv) == 4: 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 +elif len(sys.argv) == 3: # assume uTorrent but no label exists. + Logger.info("Script called from utorrent, without a Label.") + Directory = os.path.normpath(sys.argv[1]) ## %D -- Example output: F:\path\to\dir\My.Series.S01E01.720p.HDTV.x264-2HD + Name = sys.argv[2] ## %N -- Example output: My.Series.S01E01.720p.HDTV.x264-2HD + Category = '' #We dont have a category, so assume the last directory is the category for now. + elif len(sys.argv) > 1: #Doesn't match Transmission (1) or uTorrent (4). Logger.error("The number of arguments passed is %s. Unable to determin the arguments to use; Exiting", len(sys.argv)) sys.exit(-1)