File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,17 @@ add_trackers () {
66 torrent_hash=$1
77 id=$2
88for base_url in " $TORRENTLIST " ; do
9+ if [ ! -f /tmp/trackers.txt ]; then
10+ curl -o " /tmp/trackers.txt" " ${base_url} "
11+ fi
12+ Local=$( wc -c < /tmp/trackers.txt)
13+ Remote=$( curl -sI " ${base_url} " | awk ' /Content-Length/ {sub("\r",""); print $2}' )
14+ if [ $Local != $Remote ]; then
15+ curl -o " /tmp/trackers.txt" " ${base_url} "
16+ fi
917 echo " URL for ${base_url} "
1018 echo " Adding trackers for $torrent_name ..."
11- for tracker in $( curl -# " ${base_url} " ) ; do
19+ for tracker in $( cat /tmp/trackers.txt ) ; do
1220 echo -n " ${tracker} ..."
1321if transmission-remote " $HOSTPORT " --authenv --torrent " ${torrent_hash} " -td " ${tracker} " | grep -q ' success' ; then
1422 echo ' failed.'
2129 rm -f /tmp/TTAA.$id .lock
2230}
2331# Get list of active torrents
24- ids=" $( transmission-remote " $HOSTPORT " --authenv --list | grep -vE ' Seeding|Stopped|Finished' | grep ' ^ ' | awk ' { print $1 }' ) "
32+ ids=" $( transmission-remote " $HOSTPORT " --authenv --list | grep -vE ' Seeding|Stopped|Finished|[[:space:]]100%[[:space:]] ' | grep ' ^ ' | awk ' { print $1 }' ) "
2533for id in $ids ; do
2634 add_date=" $( transmission-remote " $HOSTPORT " --authenv --torrent " $id " --info| grep ' ^ Date added: ' | cut -c 21-) "
2735 add_date_t=" $( date -d " $add_date " " +%Y-%m-%d %H:%M" ) "
You can’t perform that action at this time.
0 commit comments