Adjusted rtorrent connect method to work with httprpc URIs, adjusted option descriptions
This commit is contained in:
@@ -31,8 +31,8 @@ config = [{
|
|||||||
{
|
{
|
||||||
'name': 'host',
|
'name': 'host',
|
||||||
'default': 'localhost:80',
|
'default': 'localhost:80',
|
||||||
'description': 'Hostname with port or XML-RPC Endpoint URI. Usually <strong>scgi://localhost:5000</strong> '
|
'description': 'RPC Communication URI. Usually <strong>scgi://localhost:5000</strong>, '
|
||||||
'or <strong>localhost:80</strong>'
|
'<strong>httprpc://localhost/rutorrent</strong> or <strong>localhost:80</strong>'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'ssl',
|
'name': 'ssl',
|
||||||
@@ -46,7 +46,7 @@ config = [{
|
|||||||
'type': 'string',
|
'type': 'string',
|
||||||
'default': 'RPC2',
|
'default': 'RPC2',
|
||||||
'advanced': True,
|
'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',
|
'name': 'username',
|
||||||
|
|||||||
@@ -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.downloaders.base import Downloader, ReleaseDownloadList
|
||||||
from couchpotato.core.event import fireEvent, addEvent
|
from couchpotato.core.event import fireEvent, addEvent
|
||||||
from couchpotato.core.helpers.encoding import sp
|
from couchpotato.core.helpers.encoding import sp
|
||||||
from couchpotato.core.helpers.variable import cleanHost, splitString
|
from couchpotato.core.helpers.variable import cleanHost, splitString
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
|
from base64 import b16encode, b32decode
|
||||||
|
from bencode import bencode, bdecode
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
from rtorrent import RTorrent
|
from rtorrent import RTorrent
|
||||||
from rtorrent.err import MethodError
|
from rtorrent.err import MethodError
|
||||||
|
from urlparse import urlparse
|
||||||
import os
|
import os
|
||||||
|
|
||||||
log = CPLog(__name__)
|
log = CPLog(__name__)
|
||||||
@@ -51,7 +52,12 @@ class rTorrent(Downloader):
|
|||||||
if self.rt is not None:
|
if self.rt is not None:
|
||||||
return self.rt
|
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'):
|
if self.conf('username') and self.conf('password'):
|
||||||
self.rt = RTorrent(
|
self.rt = RTorrent(
|
||||||
|
|||||||
Reference in New Issue
Block a user