From dc379491e8ceb5e3bc75403397ce9c2ab861e172 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Mon, 25 Feb 2013 22:34:24 -0800 Subject: [PATCH] Lowered utorrent args by 1. remove uselink test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we don't pass sys.argv[1] as 'utorrent' we need to reduce the input arg numbers by 1. We can't (as I understand) test for useLink here unless we pass it in... so let's just set up utorrentClass anyway and test for uselink back in TorrentToMedia.py also added try, except as this can cause issues if these parameters are not passed in... maybe a bit unnecessary, but doesn't hurt.  --- nzbToMediaUtil.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nzbToMediaUtil.py b/nzbToMediaUtil.py index 0078068d..61f96ee2 100644 --- a/nzbToMediaUtil.py +++ b/nzbToMediaUtil.py @@ -18,14 +18,17 @@ def parse_other(args): def parse_utorrent(args): # uTorrent usage: call TorrentToMedia.py "%D" "%N" "%L" "%I" - inputDirectory = os.path.normpath(sys.argv[2]) - inputName = sys.argv[3] + inputDirectory = os.path.normpath(sys.argv[1]) + inputName = sys.argv[2] try: - inputCategory = sys.argv[4] + inputCategory = sys.argv[3] except: inputCategory = '' - inputHash = sys.argv[5] - if inputHash and useLink: + try: + inputHash = sys.argv[4] + except: + inputHash = '' + if inputHash: utorrentClass = UTorrentClient(uTorrentWEBui, uTorrentUSR, uTorrentPWD) def parse_deluge(args):