autoremove-torrents
autoremove-torrents copied to clipboard
Fix broken `delete_torrents` on qbittorrent 4.5.0+
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.
Noted that changing from GET to POST may break the compatibility to qbittorrent < 4.5.
same as #160 ?
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.
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"]
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.
Tested this change on 2.8.19
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 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
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>
Next is to run it from CLI, figuring out now :)
Closes #157 #173 #182 #186
Thank you for your contribution!