예제 #1
0
    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
예제 #2
0
    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