diff --git a/couchpotato/core/downloaders/rtorrent/__init__.py b/couchpotato/core/downloaders/rtorrent/__init__.py index d0047893..f3944c7e 100755 --- a/couchpotato/core/downloaders/rtorrent/__init__.py +++ b/couchpotato/core/downloaders/rtorrent/__init__.py @@ -33,7 +33,7 @@ config = [{ }, { 'name': 'label', - 'description': 'Label to add torrent as.', + 'description': 'Label to apply on added torrents.', }, { 'name': 'paused', diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index a06ebe5e..8bd86f9e 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -25,11 +25,14 @@ class rTorrent(Downloader): rtorrent_api = None def get_conn(self): - return RTorrent( - self.conf('url'), - self.conf('username'), - self.conf('password') - ) + if self.conf('username') and self.conf('password'): + return RTorrent( + self.conf('url'), + self.conf('username'), + self.conf('password') + ) + + return RTorrent(self.conf('url')) def download(self, data, movie, filedata=None): log.debug('Sending "%s" (%s) to rTorrent.', (data.get('name'), data.get('type'))) @@ -59,7 +62,16 @@ class rTorrent(Downloader): if not self.rtorrent_api: self.rtorrent_api = self.get_conn() - torrent = self.rtorrent_api.load_torrent(filedata, not self.conf('paused', default=0)) + # Send torrent to rTorrent + torrent = self.rtorrent_api.load_torrent(filedata) + + # Set label + if self.conf('label'): + torrent.set_custom(1, self.conf('label')) + + # Start torrent + if not self.conf('paused', default=0): + torrent.start() return self.downloadReturnId(torrent_hash) except Exception, err: