From 3f6145cd07634eaa3e06b2bdd79b4567b04bbe36 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Thu, 1 May 2014 00:28:50 -0700 Subject: [PATCH] Took out debug logging, put the torrent checking in the right place --- headphones/searcher.py | 2 +- headphones/utorrent.py | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index c89720b3..6207551e 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -31,7 +31,7 @@ import subprocess import headphones from headphones.common import USER_AGENT from headphones import logger, db, helpers, classes, sab, nzbget, request -from headphones import transmission, notifiers +from headphones import utorrent, transmission, notifiers import lib.bencode as bencode diff --git a/headphones/utorrent.py b/headphones/utorrent.py index ce39020a..ff313589 100644 --- a/headphones/utorrent.py +++ b/headphones/utorrent.py @@ -37,7 +37,7 @@ def addTorrent(link, title): password = headphones.UTORRENT_PASSWORD label = headphones.UTORRENT_LABEL token = '' - logger.info("2") + if not host.startswith('http'): host = 'http://' + host @@ -52,19 +52,16 @@ def addTorrent(link, title): # Retrieve session id auth = (username, password) if username and password else None token_request = request.request_response(host + 'token.html', auth=auth) - logger.info("3") + token = re.findall('(.*?) 1: folder = os.path.basename(torrent[26])