From 4f025dd6ca15945d146e1b591f192a7861ff3342 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Thu, 2 Oct 2014 13:40:32 +0930 Subject: [PATCH] add Vuze client. #563 --- autoProcessMedia.cfg.spec | 2 +- nzbtomedia/__init__.py | 2 +- nzbtomedia/nzbToMediaUtil.py | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index 86f420ed..f7cd0b85 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -211,7 +211,7 @@ default_downloadDirectory = [Torrent] - ###### clientAgent - Supported clients: utorrent, transmission, deluge, rtorrent, other + ###### clientAgent - Supported clients: utorrent, transmission, deluge, rtorrent, vuze, other clientAgent = other ###### useLink - Set to hard for physical links, sym for symbolic links, move to move, and no to not use links (copy) useLink = hard diff --git a/nzbtomedia/__init__.py b/nzbtomedia/__init__.py index 88c34933..b74d507c 100644 --- a/nzbtomedia/__init__.py +++ b/nzbtomedia/__init__.py @@ -316,7 +316,7 @@ def initialize(section=None): if isinstance(GROUPS, str): GROUPS = GROUPS.split(',') if GROUPS == ['']: GROUPS = None - TORRENT_CLIENTAGENT = CFG["Torrent"]["clientAgent"] # utorrent | deluge | transmission | rtorrent | other + TORRENT_CLIENTAGENT = CFG["Torrent"]["clientAgent"] # utorrent | deluge | transmission | rtorrent | vuze |other USELINK = CFG["Torrent"]["useLink"] # no | hard | sym OUTPUTDIRECTORY = CFG["Torrent"]["outputDirectory"] # /abs/path/to/complete/ TORRENT_DEFAULTDIR = CFG["Torrent"]["default_downloadDirectory"] diff --git a/nzbtomedia/nzbToMediaUtil.py b/nzbtomedia/nzbToMediaUtil.py index 36efe248..cc7ad312 100644 --- a/nzbtomedia/nzbToMediaUtil.py +++ b/nzbtomedia/nzbToMediaUtil.py @@ -490,6 +490,41 @@ def parse_transmission(args): return inputDirectory, inputName, inputCategory, inputHash, inputID +def parse_vuze(args): + # vuze usage: C:\full\path\to\nzbToMedia\TorrentToMedia.py "%D%N%L%I%K%F" + try: + input = args[1].split(',') + except: + input = [] + try: + inputDirectory = os.path.normpath(input[0]) + except: + inputDirectory = '' + try: + inputName = input[1] + except: + inputName = '' + try: + inputCategory = input[2] + except: + inputCategory = '' + try: + inputHash = input[3] + except: + inputHash = '' + try: + inputID = input[3] + except: + inputID = '' + try: + if input[4] == 'single': + inputName = input[5] + except: + pass + + return inputDirectory, inputName, inputCategory, inputHash, inputID + + def parse_args(clientAgent, args): clients = { 'other': parse_other, @@ -497,6 +532,7 @@ def parse_args(clientAgent, args): 'utorrent': parse_utorrent, 'deluge': parse_deluge, 'transmission': parse_transmission, + 'vuze': parse_vuze, } try: