diff --git a/couchpotato/core/downloaders/rtorrent/__init__.py b/couchpotato/core/downloaders/rtorrent/__init__.py index 4a593fd2..f793cad1 100755 --- a/couchpotato/core/downloaders/rtorrent/__init__.py +++ b/couchpotato/core/downloaders/rtorrent/__init__.py @@ -31,8 +31,8 @@ config = [{ { 'name': 'host', 'default': 'localhost:80', - 'description': 'Hostname with port or XML-RPC Endpoint URI. Usually scgi://localhost:5000 ' - 'or localhost:80' + 'description': 'RPC Communication URI. Usually scgi://localhost:5000, ' + 'httprpc://localhost/rutorrent or localhost:80' }, { 'name': 'ssl', @@ -46,7 +46,7 @@ config = [{ 'type': 'string', 'default': 'RPC2', 'advanced': True, - 'description': 'Change if you don\'t run rTorrent RPC at the default url.', + 'description': 'Change if your RPC mount is at a different path.', }, { 'name': 'username', diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index 1fbae354..b7b18b86 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -1,14 +1,15 @@ -from base64 import b16encode, b32decode -from bencode import bencode, bdecode from couchpotato.core.downloaders.base import Downloader, ReleaseDownloadList from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.helpers.encoding import sp from couchpotato.core.helpers.variable import cleanHost, splitString from couchpotato.core.logger import CPLog +from base64 import b16encode, b32decode +from bencode import bencode, bdecode from datetime import timedelta from hashlib import sha1 from rtorrent import RTorrent from rtorrent.err import MethodError +from urlparse import urlparse import os log = CPLog(__name__) @@ -51,7 +52,12 @@ class rTorrent(Downloader): if self.rt is not None: return self.rt - url = cleanHost(self.conf('host'), protocol = True, ssl = self.conf('ssl')) + self.conf('rpc_url') + url = cleanHost(self.conf('host'), protocol = True, ssl = self.conf('ssl')) + parsed = urlparse(url) + + # rpc_url is only used on http/https scgi pass-through + if parsed.scheme in ['http', 'https']: + url += self.conf('rpc_url') if self.conf('username') and self.conf('password'): self.rt = RTorrent(