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

Fix broken delete_torrents on qbittorrent 4.5.0+ #174

Merged
merged 2 commits into from
Apr 27, 2024

Conversation

Siriussee
Copy link
Contributor

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
Copy link
Contributor Author

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

@jooleer
Copy link

jooleer commented Apr 18, 2023

same as #160 ?

@AN1MATEK
Copy link

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.

@Piste
Copy link

Piste commented Jun 18, 2023

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"]

@mduijm
Copy link

mduijm commented Jun 30, 2023

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.

@broven
Copy link

broven commented Sep 2, 2023

Tested this change on 2.8.19

@SnippetSpace
Copy link

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

@Piste
Copy link

Piste commented Oct 30, 2023

@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

@mduijm
Copy link

mduijm commented Dec 31, 2023

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: #174 (comment)
create a 2nd file: docker-entrypoint.sh
paste the following data in there: #174 (comment)
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 :, 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 :)

@jerrymakesjelly
Copy link
Owner

Closes #157 #173 #182 #186

@jerrymakesjelly jerrymakesjelly merged commit 12335fc into jerrymakesjelly:master Apr 27, 2024
@jerrymakesjelly
Copy link
Owner

Thank you for your contribution!

@jerrymakesjelly jerrymakesjelly mentioned this pull request Apr 27, 2024
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

Successfully merging this pull request may close these issues.

8 participants