[rtorrent] cleaned up connection, '+https' is now added to 'httprpc' protocol if SSL option is enabled
This commit is contained in:
@@ -59,20 +59,24 @@ class rTorrent(Downloader):
|
|||||||
return self.rt
|
return self.rt
|
||||||
|
|
||||||
url = cleanHost(self.conf('host'), protocol = True, ssl = self.conf('ssl'))
|
url = cleanHost(self.conf('host'), protocol = True, ssl = self.conf('ssl'))
|
||||||
|
|
||||||
|
# Automatically add '+https' to 'httprpc' protocol if SSL is enabled
|
||||||
|
if self.conf('ssl') and url.startswith('httprpc://'):
|
||||||
|
url = url.replace('httprpc://', 'httprpc+https://')
|
||||||
|
|
||||||
parsed = urlparse(url)
|
parsed = urlparse(url)
|
||||||
|
|
||||||
# rpc_url is only used on http/https scgi pass-through
|
# rpc_url is only used on http/https scgi pass-through
|
||||||
if parsed.scheme in ['http', 'https']:
|
if parsed.scheme in ['http', 'https']:
|
||||||
url += self.conf('rpc_url')
|
url += self.conf('rpc_url')
|
||||||
|
|
||||||
if self.conf('username') and self.conf('password'):
|
print url
|
||||||
self.rt = RTorrent(
|
|
||||||
url,
|
self.rt = RTorrent(
|
||||||
self.conf('username'),
|
url,
|
||||||
self.conf('password')
|
self.conf('username'),
|
||||||
)
|
self.conf('password')
|
||||||
else:
|
)
|
||||||
self.rt = RTorrent(url)
|
|
||||||
|
|
||||||
self.error_msg = ''
|
self.error_msg = ''
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user