Skip to content

WebUI API: setShareLimits method returns status code 400 #20110

Description

@antonkvm

qBittorrent & operating system versions

qBittorrent: v4.6.2 (64-Bit)
Operating System: Raspberry Pi OS / Debian GNU/Linux 11 (bullseye)
Qt: 6.6.1
libtorrent: 2.0.9.0

What is the problem?

Trying to use the setShareLimits API method no longer works and currently returns "400 - Bad Request". I used the same request previously in a python script, which used to work as expected. I can verify that my last successful call to that API method was on November 11th 2023, but I can't pinpoint what version I was using back then, although I do update fairly regularly. I have not changed the way I call that method since.

I have tried out using other API methods, like /torrents/addTags, using the same torrent hash and session cookie, and that still succeeds as expected.

Steps to reproduce

  1. Use the /auth/login method to fetch a session cookie
  2. Use that session cookie to make a POST request to the /torrents/setShareLimits API endpoint (see below for details)
  3. See that the HTTP response is code 400, bad request. Checking the share limits in the WebUI shows that the intended changes were not applied.

Additional context

cURL Snippet generated by Postman:

curl --location 'https://[redacted_host]/api/v2/torrents/setShareLimits' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: SID=[redacted]' \
--data-urlencode 'hashes=[redacted]' \
--data-urlencode 'ratioLimit=13.0' \
--data-urlencode 'seedingTimeLimit=13000.0'
Bildschirmfoto 2023-12-09 um 13 21 36

<< removed irrelevant logs and preferences >>

Metadata

Metadata

Assignees

No one assigned

    Labels

    WebAPIWebAPI-related issues/changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions