Bash Removing Torrents

General support for problems installing or using Deluge
Post Reply
eld
New User
New User
Posts: 5
Joined: Sun Jun 23, 2019 11:40 pm

Bash Removing Torrents

Post 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".
shamael
Compulsive Poster
Compulsive Poster
Posts: 667
Joined: Sat Oct 08, 2016 9:28 am

Re: Bash Removing Torrents

Post by shamael »

thx for sharing it ;)
Post Reply