Modify range of torrents [solved]

Discussion of Transmission that doesn't fit in the other categories
Post Reply
iMhack
Posts: 3
Joined: Sun Nov 02, 2014 10:49 am

Modify range of torrents [solved]

Post by iMhack »

Hi,
Recently a famous french tracker (t411.me) changed his port for the tracker.
I asked myself if it was possible to edit the port of a range of torrents automatically. Is there a solution (other than editing all the .torrents files) ?
Last edited by iMhack on Sun Nov 02, 2014 5:09 pm, edited 1 time in total.
tarduche
Posts: 3
Joined: Sun Nov 02, 2014 1:10 pm

Re: Modify range of torrents

Post by tarduche »

Just copy the title.
Add a tracker with plus sign below in the window.
Press Command V in the address, replace 56969 by 8880 and press Enter.
Then delete the first address with minus sign.
Hope this will be helpful.
iMhack
Posts: 3
Joined: Sun Nov 02, 2014 10:49 am

Re: Modify range of torrents

Post by iMhack »

I did know that. My question was how to edit like 10000 torrents without spending hours and weeks.

I did like that :
cd Library/Application\ Support/Transmission/Torrents/
mkdir backup && cp *.torrent backup/
for f in *.torrent; do echo $f ; LANG=C sed 's/tracker.t411.me:56969/tracker.t411.me:8880/g' "$f" > 'temp.txt' ; mv 'temp.txt' "$f" ; done

But then all my modified .torrent are no more recognised in Transmission.
Edit1:But now i realise that i didn't shut down Transmission when doing this.
Edit2:Tested with shutting down, still have the problem :-/
Edit3:As mentioned https://trac.transmissionbt.com/wiki/ConfigFiles, "This subfolder holds the .torrent files that have been added to Transmission. The files in this folder are named with a combination of the torrent's name (to make it human-readable) and a portion of the torrent's SHA1 hash (to avoid filename collisions from similarly-named torrents). "
Edit4:One more thing will be difficult, the "bencode" encoding...
Edit5:Code changed with modification of length for f in *.torrent; do echo $f ; LANG=C sed 's#70:http://tracker.t411.me:56969#69:http://tracker.t411.me:8880#g' "$f" > 'temp.txt' ; mv 'temp.txt' "$f" ; done
Post Reply