def connect(self): if self.qb is not None: self.qb.logout() url = cleanHost(self.conf('host'), protocol = True, ssl = False) if self.conf('username') and self.conf('password'): self.qb = QBittorrentClient(url) self.qb.login(username=self.conf('username'), password=self.conf('password')) else: self.qb = QBittorrentClient(url) return self.qb._is_authenticated
def connect(self): if self.qb is not None: return self.qb url = cleanHost(self.conf('host'), protocol=True, ssl=False) if self.conf('username') and self.conf('password'): self.qb = QBittorrentClient(url, username=self.conf('username'), password=self.conf('password')) else: self.qb = QBittorrentClient(url) return self.qb