Page 1 of 1

[SCRIPT] move torrent by tracker

Posted: Thu Dec 15, 2011 1:40 am
by rZn
Hi
I did some searching for a way to sort my downloaded torrents into folders based by tracker.
Did not find any way to do that (please inform me if there is another way to do this..)

So I myself a ugly hackish little bash script.. but hey it works for me.. :roll: it should work for you to :wink:
I have only tried it with single tracker torrents.

Just change user and pass in the script and enable it in settings.json

Thanks to killemov for his nice rar and cleanup script :D
I did got the idea how to do it from his script.

Code: Select all

#!/bin/bash
    # move_torrent.sh by rZn

      # Username for transmission remote.
      TR_USERNAME="user"
      # Password for transmission remote.
      TR_PASSWORD="pass"

TRACKER=$(transmission-remote -n $TR_USERNAME:$TR_PASSWORD -t$TR_TORRENT_ID -it | sed -n -e '/[:]/p' | awk '{print substr($0, index($0,$3))}' | cut -b8- | cut -d":" -f1)
mkdir -p ${TR_TORRENT_DIR}/${TRACKER}
transmission-remote -n $TR_USERNAME:$TR_PASSWORD -t$TR_TORRENT_ID --move ${TR_TORRENT_DIR}/${TRACKER}

Regards.
//rZn

Re: [SCRIPT] move torrent by tracker

Posted: Thu Dec 15, 2011 9:24 am
by blacke4dawn
You know, you should really edit out your own login info before posting things here. :mrgreen:

Re: [SCRIPT] move torrent by tracker

Posted: Sat Dec 17, 2011 8:16 pm
by rZn
hehe done.
I did remove it but I'd pasted wrong paste :p

Re: [SCRIPT] move torrent by tracker

Posted: Sun May 03, 2020 2:28 am
by flying_sausages
So I found this just now and I made some changes to this.A torrent with multiple trackers would create some pretty bizarre looking folders in the original so I fixed that and use only the first tracker.

https://gist.github.com/flying-sausages ... 5770dd2a80