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

Unable to run on qBittorrent 4.5.0 #157

Closed
PozoSer opened this issue Nov 29, 2022 · 19 comments
Closed

Unable to run on qBittorrent 4.5.0 #157

PozoSer opened this issue Nov 29, 2022 · 19 comments

Comments

@PozoSer
Copy link

PozoSer commented Nov 29, 2022

The script properly identifies the torrents to be deleted but seems unable to do so. It returns: The torrent XX and its data cannot be removed. Reason: The server responses HTTP 405. A quick search on Google indicates that a change introduced in version 4.4.5 now require "All API methods only allows GET or POST methods. Use POST when you are mutating some state (or when your request is too big to fit into GET) and use GET otherwise. Starting with qBittorrent v4.4.4, server will return 405 Method Not Allowed when you used the wrong request method."

https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)

@Sleashe
Copy link

Sleashe commented Nov 30, 2022

Yup, getting same here !

@w1zz4
Copy link

w1zz4 commented Dec 5, 2022

I confirm

Mon, 05 Dec 2022 10:10:01 autoremovetorrents.task ERROR: The torrent XXXXXX and its data cannot be removed. Reason: The server responses HTTP 405.

Jorman added a commit to Jorman/autoremove-torrents that referenced this issue Dec 14, 2022
@Jarsky
Copy link

Jarsky commented Dec 20, 2022

Just confirming also have the same error with qBitTorrent 4.5.0. Upgraded from 4.3.9 which was working fine.

Tue, 20 Dec 2022 08:35:02 autoremovetorrents.task ERROR: The torrent xxxxxx and its data cannot be removed. Reason: The server responses HTTP 405

Jarsky added a commit to Jarsky/docker-autoremove-torrents that referenced this issue Dec 21, 2022
Update Repo with patch that resolved Issue #157 (qBittorrent 4.5.0 compatibility)
jerrymakesjelly/autoremove-torrents#157
@PozoSer
Copy link
Author

PozoSer commented Dec 22, 2022

I'm still getting the same issue with the @Jorman patch.

@Jarsky
Copy link

Jarsky commented Dec 23, 2022

I'm still getting the same issue with the @Jorman patch.

Did you use the patch-1 branch?
I can confirm that it is working with Jorman's patch

image

@PozoSer
Copy link
Author

PozoSer commented Jan 3, 2023

Yeah. Tried deleting everything and re-downloading but still getting the same error.

imagen

I have manually checked that the patch changes to the qBittorrent.py file in lines 113 and 119 are in fact downloaded and it seems like it. These are the only changes in the patch as far as I've noticed.

imagen

@Jorman
Copy link

Jorman commented Jan 10, 2023

@PozoSer
Yes, is the only modification.
You can also modify it by hand, for example I use autoremove-torrents with python venv, so I manually edited the file, but I remember I also update python version inside venv, so in this case I've two dirctory for autoremove-torrent, the old one and the new one.
How do you have configured it?
qBittorrent version?
Phyton version?

@PozoSer
Copy link
Author

PozoSer commented Jan 21, 2023

Thanks Jorman for the interest and help. I finally got it to work by manually uninstalling it and downloading it again. For some reason overwriting the autoremove-torrents folder was not working.

ludoux added a commit to ludoux/autoremove-torrents that referenced this issue Mar 3, 2023
@Alcedema
Copy link

Alcedema commented Mar 4, 2023

I'm still receiving the 405 error, even when using the new patch-1 branch.

I uninstalled the old one completely;

python3 setup.py install --record files.txt
cat files.txt | xargs rm -rf
rm autoremove-torrents
which autoremove-torrents

Then installed the Jorman patch (and confirmed modifications);

git clone -b patch-1 http://github.com/Jorman/autoremove-torrents.git
cd autoremove-torrents
awk 'NR==113' ./autoremovetorrents/client/qbittorrent.py 
            _return self._session.post(self._host+'/api/v2/torrents/delete', data={'hashes':'|'.join(torrent_hash_list), 'deleteFiles': False})_
python3 setup.py install
which autoremove-torrents 
            _/usr/bin/autoremove-torrents_

Ran ART (after --view to confirm);

/usr/bin/autoremove-torrents --conf=/etc/autotorrent/config.yml

Sat, 04 Mar 2023 09:29:05 autoremovetorrents.main INFO: Auto Remove Torrents 1.5.4
Sat, 04 Mar 2023 09:29:05 autoremovetorrents.main INFO: Loading configurations...
Sat, 04 Mar 2023 09:29:05 autoremovetorrents.main INFO: Found 1 task(s) in the file.
Sat, 04 Mar 2023 09:29:05 autoremovetorrents.task INFO: Running task 'my_task'...
Sat, 04 Mar 2023 09:29:05 autoremovetorrents.task INFO: Logging in...
Sat, 04 Mar 2023 09:29:05 autoremovetorrents.task INFO: Login successfully. The client is qBittorrent v4.5.2.
Sat, 04 Mar 2023 09:29:05 autoremovetorrents.task INFO: WebUI API version: 2.8.19 (v2)
Sat, 04 Mar 2023 09:29:08 autoremovetorrents.task INFO: Status reported by the client: 
...
Sat, 04 Mar 2023 09:30:02 autoremovetorrents.strategy INFO: Total: 1 torrent(s). 1 torrent(s) can be removed.
Sat, 04 Mar 2023 09:30:02 autoremovetorrents.strategy INFO: To be deleted:
...
Sat, 04 Mar 2023 09:30:03 autoremovetorrents.task ERROR: The torrent REDACTED and its data cannot be removed. Reason: The server responses HTTP 405.

@speedster-pta
Copy link

Hey guys. Anyone able to help me het this working? I installed autoremove-torrents via pip this morning and am getting the 405 error on qBittorrent.

@Jorman
Copy link

Jorman commented Sep 28, 2023

Hi, you've to clone the patch version in order to use it, see my log:

Thu, 28 Sep 2023 14:25:51 main.py[line:51] INFO Auto Remove Torrents 1.5.4
Thu, 28 Sep 2023 14:25:52 main.py[line:53] INFO Loading configurations...
Thu, 28 Sep 2023 14:25:52 main.py[line:56] INFO Found 1 task(s) in the file.
Thu, 28 Sep 2023 14:25:52 task.py[line:138] INFO Running task 'qBittorrent'...
Thu, 28 Sep 2023 14:25:52 task.py[line:85] INFO Logging in...
Thu, 28 Sep 2023 14:25:52 task.py[line:87] INFO Login successfully. The client is qBittorrent v4.5.5.
Thu, 28 Sep 2023 14:25:52 task.py[line:88] INFO WebUI API version: 2.8.19 (v2)
Thu, 28 Sep 2023 14:25:52 task.py[line:92] INFO Status reported by the client: 
	Download Speed: 0.00B/s	Total: 73.17GiB
	Upload Speed: 0.00B/s	Total: 161.99GiB
Thu, 28 Sep 2023 14:25:52 task.py[line:96] INFO Getting all the torrents...
Thu, 28 Sep 2023 14:25:53 task.py[line:103] INFO Please wait...We have found 82 torrent(s).
Thu, 28 Sep 2023 14:25:53 task.py[line:106] INFO Found 142 torrent(s) in the client.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker1...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker2...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker3...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker4...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker5...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker6...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker7...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker8...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-Tracker9...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 3 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-10...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-Tracker11...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 23 torrent(s). 1 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:177] INFO To be deleted:
Thu, 28 Sep 2023 14:25:54 strategy.py[line:179] INFO xxx
	Progress:100.00%	Size:19.46GiB	Ratio:0.354	Total Uploaded:6.88GiB
	Seeder(connected/total):0/31	Leecher(connected/total):1/1	Status:Uploading
	Download Speed:0.00B/s(Avg.:34.54MiB/s)	Upload Speed:0.00B/s(Avg.:9.14KiB/s)
	Create Time:2023-09-19 11:13:05	Seeding Time:9d 03:02:55	Downloading Time:(Not Provided)	Last Activity:1d 00:41:39
	Category:FreeLeech	Tracker:** [DHT] **,** [PeX] **,** [LSD] **,xxx
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-Tracker12...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Global-Tracker...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 task.py[line:125] INFO The torrent xxx and its data have been removed.

@speedster-pta
Copy link

Hi, you've to clone the patch version in order to use it, see my log:

Thu, 28 Sep 2023 14:25:51 main.py[line:51] INFO Auto Remove Torrents 1.5.4
Thu, 28 Sep 2023 14:25:52 main.py[line:53] INFO Loading configurations...
Thu, 28 Sep 2023 14:25:52 main.py[line:56] INFO Found 1 task(s) in the file.
Thu, 28 Sep 2023 14:25:52 task.py[line:138] INFO Running task 'qBittorrent'...
Thu, 28 Sep 2023 14:25:52 task.py[line:85] INFO Logging in...
Thu, 28 Sep 2023 14:25:52 task.py[line:87] INFO Login successfully. The client is qBittorrent v4.5.5.
Thu, 28 Sep 2023 14:25:52 task.py[line:88] INFO WebUI API version: 2.8.19 (v2)
Thu, 28 Sep 2023 14:25:52 task.py[line:92] INFO Status reported by the client: 
	Download Speed: 0.00B/s	Total: 73.17GiB
	Upload Speed: 0.00B/s	Total: 161.99GiB
Thu, 28 Sep 2023 14:25:52 task.py[line:96] INFO Getting all the torrents...
Thu, 28 Sep 2023 14:25:53 task.py[line:103] INFO Please wait...We have found 82 torrent(s).
Thu, 28 Sep 2023 14:25:53 task.py[line:106] INFO Found 142 torrent(s) in the client.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker1...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker2...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker3...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker4...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker5...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker6...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker7...
Thu, 28 Sep 2023 14:25:53 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:53 strategy.py[line:167] INFO Running strategy Private-Tracker8...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-Tracker9...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 3 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-10...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-Tracker11...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 23 torrent(s). 1 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:177] INFO To be deleted:
Thu, 28 Sep 2023 14:25:54 strategy.py[line:179] INFO xxx
	Progress:100.00%	Size:19.46GiB	Ratio:0.354	Total Uploaded:6.88GiB
	Seeder(connected/total):0/31	Leecher(connected/total):1/1	Status:Uploading
	Download Speed:0.00B/s(Avg.:34.54MiB/s)	Upload Speed:0.00B/s(Avg.:9.14KiB/s)
	Create Time:2023-09-19 11:13:05	Seeding Time:9d 03:02:55	Downloading Time:(Not Provided)	Last Activity:1d 00:41:39
	Category:FreeLeech	Tracker:** [DHT] **,** [PeX] **,** [LSD] **,xxx
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Private-Tracker12...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 strategy.py[line:167] INFO Running strategy Global-Tracker...
Thu, 28 Sep 2023 14:25:54 strategy.py[line:174] INFO Total: 0 torrent(s). 0 torrent(s) can be removed.
Thu, 28 Sep 2023 14:25:54 task.py[line:125] INFO The torrent xxx and its data have been removed.

Thanks for the feedback. Are you perhaps able to help me (or point me to a link) about how the cloning works?

@Jorman
Copy link

Jorman commented Sep 30, 2023

I personally use venv, I prefer to "trap" each python project, so maybe is not so easy
You can also modify the file by hand, but you've to modify the right one.
I use python 3.9 inside venv, pay attention because is possible that you've more than one version of python and you've to modify the file for the version you use, for this I only use venv :)

If you want I can explain how I personally use venv for this project

@Jorman
Copy link

Jorman commented Sep 30, 2023

The simple way, for my point of view, is to navigate where do you want to store the venv

  1. Prepare the venv
    python3 -m venv autoremove-torrent
  2. Activate the Virtual Environment
    source autoremove-torrent/bin/activate
  3. Install the git version with patch
    pip install git+https://github.com/Jorman/autoremove-torrents@patch-1
  4. Install/upgrade pip wheel and setuptools (maybe not necessary but I prefer to)
    pip install --upgrade pip setuptools wheel
  5. Deactivate the Virtual Environment (because I use it not from inside the Virtual Environment but from outsie)
    deactivate
  6. Now you can test the program with
    /path_to_the_venv_autoremove_torrent_folder/bin/autoremove-torrents --conf=/path_to_your_config_file/config.yml --view --debug
  7. To use the program from outside
    /path_to_the_venv_autoremove_torrent_folder/autoremove-torrents --conf=/path_to_your_config_file/config.yml --log=/path_where_you_want_to_save_the_logs/logs

@blastbeng
Copy link

I am still experiencing this issue with qbit v4.6.2.

I have installed the repo version with patch:
pip install git+https://github.com/Jorman/autoremove-torrents@patch-1

Does anyone ever solved this problem?

@Jorman
Copy link

Jorman commented Dec 11, 2023

@blastbeng
Do you removed all the old instance?
Do you have more than one python version installed?
Follow my instruction to use the program inside a venv environment, otherwise you've to be sure to install and use the right version, for example for python 3 etc.
I use the patched version for the latest qBittorrent and is still working, no problem at all

@blastbeng
Copy link

blastbeng commented Dec 11, 2023

@Jorman
I have solved using this project inside a python project:

https://github.com/blastbeng/qbittorrent-fix-stalled

I have imported your lib and now I manually launch the process using a scheduler or a rest API.

EDIT:
@Jorman i think it would be helpful to have a way to import this as a python module inside another project.
I had some troubles setting up the logs, because they're like hardcoded inside your application and now i can't disable the DEBUG messages.

@Jorman
Copy link

Jorman commented Dec 14, 2023

@blastbeng
Glad to know that you resolved, I don't use python project, I use the venv functionality to use all python script.
Please take note that I only made a patch, this project remains the same as before so logs are in the same place, like if you use the main jerrymakesjelly project. I'm not an expert on python projects but I think it is normal that all remain inside the project. Maybe check the wiki from the main project to know how to manage logs, I personally use a systemd timer with a script that check hardlinks and launch specific autoremove-torrent configuration and all the python project are inside the venv environment

@Morcegolas
Copy link

Morcegolas commented Jan 21, 2024

Hello.
First let me thanks Jorman for resolving this problem.
Second I must ask for anybody that can help me, I'm using docker container to autoremove-torrents on my NAS, but I don't know how to update qbittorrent.py. I already tried to run 'find . -name qbittorrent.py' inside the container but without any result.
If anybody can help me I'll be grateful, I already searched but can't find any updated container that have this patch.

EDIT: https://hub.docker.com/r/halfcoke/autoremove-torrents
This docker image is working perfectly. Thanks.

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

9 participants