First time interacting here. it helped me several times, but I'm lost this time.
I got a script to remove stalled/ended torrents from @bulljit. (I don't know if I can/should put his Github here. Sorry if I'm wrong).
The original code is here:
https://gist.github.com/bulljit/791609/3d3e3f9ed7d3d9ad140c2bade503b5864bd475bb
But I decided to go one step further and set a RATIO value for the seeding since my internet connection is not the best around.
Here is what I came up with: (Thechanges that I made is inside the {} since there is none of it in the code.)
#!/bin/sh
# the folder to move completed downloads to port, username,
# password
SERVER="192.168.1.105:9091"
# use transmission-remote to get torrent list from
# transmission-remote list use sed to delete first / last line
# of output, and remove leading spaces use cut to get first
# field from each line
TORRENTLIST=`transmission-remote $SERVER --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=" " --fields=1`
transmission-remote $SERVER --list
# for each torrent in the list
for TORRENTID in $TORRENTLIST
do
echo Processing : $TORRENTID
# check if torrent download is completed
DL_COMPLETED=`transmission-remote $SERVER --torrent $TORRENTID --info | grep "Percent Done: 100%"`
# check torrents current state is
STATE_STOPPED=`transmission-remote $SERVER --torrent $TORRENTID --info | grep "State: Seeding\|Stopped\|Finished\|Idle"`
echo $STATE_STOPPED
{
**#check if the selected Ratio was completed
RATIO=`echo "$INFO" | grep "Ratio: 0.5"`**
}
# if the torrent is "Stopped", "Finished", or "Idle" after
# downloading 100%"
if [ "$DL_COMPLETED" ] && [ "$STATE_STOPPED" ] {&& [ "$RATIO" != "0.5" ]}; then
echo "$SERVER and $TORRENTID and TORRENTLIST"
# move the files and remove the torrent from Transmission
echo "Torrent #$TORRENTID is completed"
echo "Removing torrent from list"
transmission-remote $SERVER --torrent $TORRENTID --remove
else
echo "Torrent #$TORRENTID is not completed. Ignoring."
fi
done
The issue is that I don't download as much as one can think I do, but I would like to mess around and play with such features. But all torrents are removed, not only the ones that finished seeding.
Sorry if I'm in the wrong forum...