test: add local 2x2 route topology
This commit is contained in:
@@ -125,10 +125,14 @@ class QBittorrentReader:
|
||||
headers={"Content-Type": "application/x-www-form-urlencoded"},
|
||||
)
|
||||
try:
|
||||
response = self._read(self._opener.open(call, timeout=self.timeout), 64)
|
||||
login_response = self._opener.open(call, timeout=self.timeout)
|
||||
login_status = getattr(login_response, "status", 200)
|
||||
response = self._read(login_response, 64)
|
||||
except (error.URLError, OSError) as exc:
|
||||
raise QBittorrentError("qBittorrent authentication failed") from exc
|
||||
if response.strip() != b"Ok.":
|
||||
if response.strip() != b"Ok." and not (
|
||||
login_status == 204 and not response.strip()
|
||||
):
|
||||
raise QBittorrentError("qBittorrent authentication failed")
|
||||
self._authenticated = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user