The error looked like this:
Code: Select all
autoremovetorrents.exception.loginfailure.LoginFailure: The server returned HTTP 204.
There is an upstream pull request that fixes this by accepting any HTTP 2xx response instead of only 200:
https://github.com/jerrymakesjelly/auto ... issues/210
https://github.com/jerrymakesjelly/auto ... s/pull/211
1. Activate the virtualenv
Code: Select all
source ~/virtualenv/bin/activate
Code: Select all
python - <<'PY'
import inspect
import autoremovetorrents.client.qbittorrent as q
print(inspect.getsourcefile(q))
PY
The broken check only accepts HTTP 200:
Code: Select all
if request.status_code == 200:
Code: Select all
if 200 <= request.status_code < 300:
Code: Select all
FILE=$(python - <<'PY'
import inspect
import autoremovetorrents.client.qbittorrent as q
print(inspect.getsourcefile(q))
PY
)
cp "$FILE" "$FILE.bak.$(date +%Y%m%d%H%M%S)"
python - <<PY
from pathlib import Path
path = Path("$FILE")
text = path.read_text()
old = "if request.status_code == 200:"
new = "if 200 <= request.status_code < 300:"
if old not in text:
raise SystemExit(f"Did not find expected line in {path}")
path.write_text(text.replace(old, new, 1))
print(f"Patched {path}")
PY