Adding global trackers from the web api (qbittorrent version 4.1.5)

Other platforms, generic questions.
Post Reply
Posts: 1
Joined: Thu Nov 26, 2020 5:27 pm

Adding global trackers from the web api (qbittorrent version 4.1.5)

Post by DeSjeik »


I have searched the forum and could not find this issue described in the forum.
If it is I apologize for the duplicate request. Can you them point me to the right topic?

I'm trying to set a couple of options for qBittorrent v4.1.5 using the web api.
The issue I'm having is that I can change either add_trackers_enabled or add_trackers. However once I have done one, the next will reset the first.

I am able to successfully set the listen_port option through the web api.

Get the cookie ("Bypass authentication for clients on localhost" is enabled):
/usr/bin/curl --silent --fail --show-error --cookie /qbittorrent/qbt_cookie.txt --cookie-jar /qbittorrent/qbt_cookie.txt --header "Referer: http://localhost:8118" --data "username=&password=" http://localhost:8118/api/v2/auth/login

Get all preferences in a list works:
/usr/bin/curl --silent --fail --show-error --cookie /qbittorrent/qbt_cookie.txt --cookie-jar /qbittorrent/qbt_cookie.txt "http://localhost:8118/api/v2/app/preferences"

Set Trackers enabled:
/usr/bin/curl --silent --fail --show-error --cookie /qbittorrent/qbt_cookie.txt --cookie-jar /qbittorrent/qbt_cookie.txt "http://localhost:8118/api/v2/app/setPreferences" --data 'json={"add_trackers_enabled": "true" }'

Add tracker:
/usr/bin/curl --silent --fail --show-error --cookie /qbittorrent/qbt_cookie.txt --cookie-jar /qbittorrent/qbt_cookie.txt "http://localhost:8118/api/v2/app/setPreferences" --data 'json={"add_trackers":"udp://"}'

I just run the commands in sequence and they all seem to go correct.
At this point however the add_trackers_enabled shows false again both from the UI as well as when running the Get preferences command.

Any help to get this to work is appreciated.

Post Reply