autoremove-torrents icon indicating copy to clipboard operation
autoremove-torrents copied to clipboard

Fix broken `delete_torrents` on qbittorrent 4.5.0+

Open Siriussee opened this issue 1 year ago • 9 comments

qbittorrent did not update their official web API doc, but according to the discussion in qBittorrent/issues/18097, I changed the GET method to POST. Test pass in Unraid 6.11, qbittorrent 4.5.2, python 3.8.5.

Siriussee avatar Apr 08 '23 21:04 Siriussee

Noted that changing from GET to POST may break the compatibility to qbittorrent < 4.5.

Siriussee avatar Apr 08 '23 21:04 Siriussee

same as #160 ?

jooleer avatar Apr 18 '23 10:04 jooleer

I woud give so much for this just to be merged and usable with pip install. Somehow it does not work for me with other install methods.

AN1MATEK avatar May 23 '23 10:05 AN1MATEK

I used this branch because of the broken delete_torrents. Thanks a lot for offering it. Here is the dockerfile I use to run this as a container:

FROM python:3.9-slim

WORKDIR /app

# Install git
RUN apt-get update && apt-get install -y git

# Clone the specific branch from the GitHub repository
RUN git clone --branch patch-1 https://github.com/Jorman/autoremove-torrents.git

# Navigate into the cloned directory
WORKDIR /app/autoremove-torrents

# Install the package
RUN python setup.py install

# Navigate back to the app directory
WORKDIR /app

COPY . /app
COPY docker-entrypoint.sh /app

RUN chmod +x /app/docker-entrypoint.sh

ENTRYPOINT ["/app/docker-entrypoint.sh"]

Piste avatar Jun 18 '23 21:06 Piste

if you don't want to run docker and just run the code, please install the 'original' version. Then edit the files in the /autoremovetorrents/client/qbittorrent.py script. See the changed code from this commit. After that run the command: python setup.py install from the /automemovetorrents folder and the new version will be compiled. Then you can run it and it is working. FYI you only need to change 2x get to post and 2x params to data.

mduijm avatar Jun 30 '23 06:06 mduijm

Tested this change on 2.8.19

broven avatar Sep 02 '23 13:09 broven

I used this branch because of the broken delete_torrents. Thanks a lot for offering it. Here is the dockerfile I use to run this as a container:

FROM python:3.9-slim

WORKDIR /app

# Install git
RUN apt-get update && apt-get install -y git

# Clone the specific branch from the GitHub repository
RUN git clone --branch patch-1 https://github.com/Jorman/autoremove-torrents.git

# Navigate into the cloned directory
WORKDIR /app/autoremove-torrents

# Install the package
RUN python setup.py install

# Navigate back to the app directory
WORKDIR /app

COPY . /app
COPY docker-entrypoint.sh /app

RUN chmod +x /app/docker-entrypoint.sh

ENTRYPOINT ["/app/docker-entrypoint.sh"]

@Piste Hey, i'm new to dockerfiles and trying to compile a container like you. Can you clarify what you put inside of your docker-entrypoint.sh file? thanks

SnippetSpace avatar Oct 30 '23 13:10 SnippetSpace

@SnippetSpace I think that the only change that I made was to docker-entrypoint.sh so as to keep an option to run autoremove-torrents in view-only mode or not:

#!/bin/bash 
while true
do
# Check if the environment variable is set to true
    if [ "$ART_VIEW" = "true" ]; then
        echo "View deletion, do not execute."
        autoremove-torrents --view --conf=/config/$ART_CONFIG_FILE
    else
        echo "Executing deletion."
        autoremove-torrents --conf=/config/$ART_CONFIG_FILE
    fi
    sleep 3600
done

Piste avatar Oct 30 '23 14:10 Piste

Hi,

As I have issues running the script locally, I created the docker:

For people new to it: make a folder put a file in there called Dockerfile, paste the above data inside: https://github.com/jerrymakesjelly/autoremove-torrents/pull/174#issuecomment-1785262133 create a 2nd file: docker-entrypoint.sh paste the following data in there: https://github.com/jerrymakesjelly/autoremove-torrents/pull/174#issuecomment-1785308696 than run: docker build . it should make a docker file, you can see it with the command: docker images Now you can tag it using: docker tag <image ID> :, fe. docker tag mduijm/autoremove-torrents:v1 then I push it into my dockerhub account: docker push mduijm/autoremove-torrents:v1 Now you have the docker image saved on dockerhub (you need an account on dockerhub, mine is: mduijm, hence the name of the docker tag: mduijm/xxx:xx

Next is to run it from CLI, figuring out now :)

mduijm avatar Dec 31 '23 13:12 mduijm

Closes #157 #173 #182 #186

jerrymakesjelly avatar Apr 27 '24 04:04 jerrymakesjelly

Thank you for your contribution!

jerrymakesjelly avatar Apr 27 '24 04:04 jerrymakesjelly