Python examples for the WebAPI
Posted: Fri Oct 17, 2014 8:15 pm
I have not found Python examples for the WebAPI, and my own examples don't work.
Could someone correct the examples below or link to working examples?
Thank you.
The WebAPI is documented here
https://github.com/qbittorrent/qBittorr ... umentation
This Python script should shutdown qBittorrent-nox
import requests
from requests.auth import HTTPDigestAuth
response = requests.get('http://127.0.0.1:8080/command/shutdown', auth=HTTPDigestAuth("admin", "adminadmin"))
if not response.ok:
response.raise_for_status()
response.content
No effect The script returns without error, but qBittorrent-nox still runs.
=====================================
This Python script should list the torrents
import requests
from requests.auth import HTTPDigestAuth
response = requests.get('http://127.0.0.1:8080/json/torrents', auth=HTTPDigestAuth("admin", "adminadmin"))
if not response.ok:
response.raise_for_status()
response.content
Negative Result The script throws HTTPError: 404 Client Error: File not found
======================================
Could someone correct the examples below or link to working examples?
Thank you.
The WebAPI is documented here
https://github.com/qbittorrent/qBittorr ... umentation
This Python script should shutdown qBittorrent-nox
import requests
from requests.auth import HTTPDigestAuth
response = requests.get('http://127.0.0.1:8080/command/shutdown', auth=HTTPDigestAuth("admin", "adminadmin"))
if not response.ok:
response.raise_for_status()
response.content
No effect The script returns without error, but qBittorrent-nox still runs.
=====================================
This Python script should list the torrents
import requests
from requests.auth import HTTPDigestAuth
response = requests.get('http://127.0.0.1:8080/json/torrents', auth=HTTPDigestAuth("admin", "adminadmin"))
if not response.ok:
response.raise_for_status()
response.content
Negative Result The script throws HTTPError: 404 Client Error: File not found
======================================