base_url='https://torrentz2.eu'
announce_list=$(wget --no-check-certificate -qO - "${base_url}"/"${torrent_hash}" | grep -Eo "${pattern}")
for tracker in $(wget --no-check-certificate -qO - "${base_url}"/"${announce_list}") ; do
	base_url='https://torrents.me/s'
announce_list=$(wget --no-check-certificate -qO - "${base_url}"/"${torrent_hash}":torrentz2/ | grep -Eo "${pattern}")
for tracker in $(wget --no-check-certificate -qO - "${base_url}"/"${announce_list}":torrentz2/) ; do
	    if [ -z "$announce_list" ] ; then
        echo 'No additional trackers found, sorry.'
        echo "${base_url}"/"${torrent_hash}":torrentz2/
        return
    fi
	#!/bin/sh
#https://github.com/DontBeAPadavan/add_trackers/blob/master/add_trackers.sh
# Get transmission credentials
auth='user:pass'
add_trackers () {
    torrent_hash=$1
    #orig: base_url='https://torrentz2.eu'
    base_url='https://torrents.me/s'
    pattern='announcelist_[0-9]+'
    #orig: announce_list=$(wget --no-check-certificate -qO - "${base_url}"/"${torrent_hash}" | grep -Eo "${pattern}")
    announce_list=$(wget --no-check-certificate -qO - "${base_url}"/"${torrent_hash}":torrentz2/ | grep -Eo "${pattern}")
    if [ -z "$announce_list" ] ; then
        echo 'No additional trackers found, sorry.'
        echo "${base_url}"/"${torrent_hash}":torrentz2/
        return
    fi
    echo "adding trackers for $torrent_hash..."
    #orig: for tracker in $(wget --no-check-certificate -qO - "${base_url}"/"${announce_list}") ; do
    for tracker in $(wget --no-check-certificate -qO - "${base_url}"/"${announce_list}":torrentz2/) ; do
        echo -n "* ${tracker}..."
        if transmission-remote  --auth="$auth" --torrent "${torrent_hash}" -td "${tracker}" | grep -q 'success'; then
            echo ' failed.'
        else
            echo ' done.'
        fi
    done
}
# Get list of active torrents
ids="$(transmission-remote --auth="$auth" --list | grep -vE 'Seeding|Stopped|Finished' | grep '^ ' | awk '{ print $1 }')"
for id in $ids ; do
    echo "Processing torrent #$id..."
    hash="$(transmission-remote --auth="$auth"  --torrent "$id" --info | grep '^  Hash: ' | awk '{ print $2 }')"
    add_trackers "$hash"
done
	Processing torrent #xx...
https://torrents.me/s/45321e951bfa2dbd3e179f996f8275317bc7ccb6:torrentz2/
No additional trackers found, sorry.
	
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!