From 3bb44f8d9f9305521a6a02b952fd9242bef7a499 Mon Sep 17 00:00:00 2001 From: mano3m Date: Mon, 13 Jan 2014 23:14:18 +0100 Subject: [PATCH] Migrate rTorrent options --- couchpotato/core/downloaders/rtorrent/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index 5cf4da22..7dc6abbf 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -1,6 +1,7 @@ from base64 import b16encode, b32decode from bencode import bencode, bdecode from couchpotato.core.downloaders.base import Downloader, ReleaseDownloadList +from couchpotato.core.event import fireEvent from couchpotato.core.helpers.encoding import sp from couchpotato.core.helpers.variable import cleanHost from couchpotato.core.logger import CPLog @@ -18,6 +19,15 @@ class rTorrent(Downloader): protocol = ['torrent', 'torrent_magnet'] rt = None + # Migration url to host options + def __init__(self): + super(rTorrent, self).__init__() + if self.conf('url'): + self.conf('ssl', value = (self.conf('url').split('://')[0].strip() == 'https')) + self.conf('host', value = self.conf('url').split('://')[-1].split('/')[0].strip()) + self.conf('rpc_url', value = self.conf('url').split('://')[-1].split('/',1)[1].strip('/ ')) + self.conf('url', value = '') + def connect(self): # Already connected? if self.rt is not None: