Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data cannot be removed. Reason: The server responses HTTP 405. #186

Open
xiaojunanann opened this issue Feb 27, 2024 · 7 comments
Open

data cannot be removed. Reason: The server responses HTTP 405. #186

xiaojunanann opened this issue Feb 27, 2024 · 7 comments

Comments

@xiaojunanann
Copy link

xiaojunanann commented Feb 27, 2024

您好,关于删种时xx data cannot be removed. Reason: The server responses HTTP 405.
该报错是哪边出问题呢?

@Jarsky
Copy link

Jarsky commented Mar 14, 2024

The issue is from this bit of code in autoremovetorrents > client > qbittorrent.py
Seems something has changed with the method on qBitTorrents end, but not sure what the fix is

  # Batch Remove Torrents
    # Return values: (success_hash_list, failed_list -> {hash: reason, ...})
    def remove_torrents(self, torrent_hash_list, remove_data):
        **request = self._request_handler.delete_torrents_and_data(torrent_hash_list) if remove_data \
            else self._request_handler.delete_torrents(torrent_hash_list)**
        if request.status_code != 200:
            return ([], [{
                'hash': torrent,
                'reason': 'The server responses HTTP %d.' % request.status_code,
            } for torrent in torrent_hash_list])
        # Some of them may fail but we can't judge them,
        # So we consider all of them as successful.
        return (torrent_hash_list, [])

@warioguy64
Copy link

Same problem. The server responses HTTP 405.

@aormond
Copy link

aormond commented Mar 25, 2024

I can't find any documentation about it, but it seems like maybe the 'deletePerm' command has been removed from the qBittorrent API?

@Jarsky
Copy link

Jarsky commented Apr 1, 2024

I can't find any documentation about it, but it seems like maybe the 'deletePerm' command has been removed from the qBittorrent API?

Im in the same boat, it looks like the command is still correct per the API documentation

From the qBitTorrent Implementation:

Delete torrents
Requires knowing the torrent hashes. You can get it from torrent list.

Name: delete

Parameters:

Parameter Type Description
hashes string The hashes of the torrents you want to delete. hashes can contain multiple hashes separated by |, to delete multiple torrents, or set to all, to delete all torrents.
deleteFiles If set to true, the downloaded data will also be deleted, otherwise has no effect.
Example:

/api/v2/torrents/delete?hashes=8c212779b4abde7c6bc608063a0d008b7e40ce32&deleteFiles=false

Currently this file looks like this:

        # Batch Delete torrents
        def delete_torrents(self, torrent_hash_list):
            return self._session.get(self._host+'/api/v2/torrents/delete', params={'hashes':'|'.join(torrent_hash_list), 'deleteFiles': False})
        
        # Batch Delete torrents and data
        def delete_torrents_and_data(self, torrent_hash_list):
            return self._session.get(self._host+'/api/v2/torrents/delete', params={'hashes':'|'.join(torrent_hash_list), 'deleteFiles': True})

Something has changed on the qBitTorrent end but it doesnt seem to be documented

@MuhammadBayiz
Copy link

Same here

@MuhammadBayiz
Copy link

I found a working fork from ludoux here:
https://github.com/ludoux/autoremove-torrents

Apparently the api calling method was wrong and he fixed it with this commit:
87c073f#diff-73fd7865a6aef90b719f0e902d8f9e7a69eb2a4d1198b84f4da0930031e692c1

@Jarsky
Copy link

Jarsky commented Apr 15, 2024

Yup sorry fixed mine with that same change as well. Turned out its due to qBitTorrent complying with using POST instead of GET for anything that requires a change.

jerrymakesjelly added a commit that referenced this issue Apr 27, 2024
closes #157 #173 #182 #186

* docs: add description of version 1.5.5

* docs: update README

* release: version 1.5.5

* fix: typos in previous version description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants