diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 7d558b1a..5191ee7b 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -177,7 +177,7 @@
Torrents - Black Hole Transmission uTorrent + Black Hole Transmission
@@ -186,7 +186,7 @@ Folder your Download program watches for Torrents
-
+
@@ -200,8 +200,11 @@
+
+ Note: With Transmission, you can specify a different download directory for downloads sent from Headphones. + Set it in the Music Download Directory below
-
+
diff --git a/headphones/utorrent.py b/headphones/utorrent.py index e464495b..fca5f5e3 100644 --- a/headphones/utorrent.py +++ b/headphones/utorrent.py @@ -12,99 +12,3 @@ # # You should have received a copy of the GNU General Public License # along with Headphones. If not, see . - -## uTorrentAPI class taken from CouchPotatoServer -## http://github.com/RuudBurger/CouchPotatoServer - -class uTorrentAPI(object): - - def __init__(self, host = 'localhost', port = 8000, username = None, password = None): - - super(uTorrentAPI, self).__init__() - - self.url = 'http://' + str(host) + ':' + str(port) + '/gui/' - self.token = '' - self.last_time = time.time() - cookies = cookielib.CookieJar() - self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies), MultipartPostHandler) - self.opener.addheaders = [('User-agent', 'couchpotato-utorrent-client/1.0')] - if username and password: - password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() - password_manager.add_password(realm = None, uri = self.url, user = username, passwd = password) - self.opener.add_handler(urllib2.HTTPBasicAuthHandler(password_manager)) - self.opener.add_handler(urllib2.HTTPDigestAuthHandler(password_manager)) - elif username or password: - log.debug('User or password missing, not using authentication.') - self.token = self.get_token() - - def _request(self, action, data = None): - if time.time() > self.last_time + 1800: - self.last_time = time.time() - self.token = self.get_token() - request = urllib2.Request(self.url + "?token=" + self.token + "&" + action, data) - try: - open_request = self.opener.open(request) - response = open_request.read() - if response: - return response - else: - log.debug('Unknown failure sending command to uTorrent. Return text is: %s', response) - except httplib.InvalidURL, err: - log.error('Invalid uTorrent host, check your config %s', err) - except urllib2.HTTPError, err: - if err.code == 401: - log.error('Invalid uTorrent Username or Password, check your config') - else: - log.error('uTorrent HTTPError: %s', err) - except urllib2.URLError, err: - log.error('Unable to connect to uTorrent %s', err) - return False - - def get_token(self): - request = self.opener.open(self.url + "token.html") - token = re.findall("(.*?)