Page 1 of 1

Bash Removing Torrents

Posted: Fri May 15, 2020 2:02 am
by eld
Personally I had found a lot of issues with the plugins for removing torrents and their data. Mostly because I do not seed, yes shame me. However just want to relay the script if anyone wants it / wants to adjust it to their needs. Quick run through, connecting to deluge with deluge-console grabbing "info" and parsing that information to just get the torrent ID. Then just removing all the torrents from "removetorrents.txt". Enjoy, let me know if you had a question.

Code: Select all

#!/bin/sh

deluge-console "connect 127.0.0.1:58846 <username> <password> ; info" |grep "100%" | awk '{print $NF}' > /home/deluge/.config/deluge/removetorrents.txt

while read i
 do
        deluge-console "connect 127.0.0.1:58846 <username> <password>; rm --remove_data -c '$i'"
 done < /home/deluge/.config/deluge/removetorrents.txt
EDIT: This is Ubuntu, should work with most linux distro. Also if you want to avoid just using plugins all together, you can just adjust the "grep" to be whatever you want. For example, grep -i <state of torrent>. Which just greps that entire line for say "seeding" or "complete".

Re: Bash Removing Torrents

Posted: Mon May 18, 2020 9:38 am
by shamael
thx for sharing it ;)