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 @@ -9,9 +9,17 @@ add_trackers () {
99 torrent_hash=$1
1010 id=$2
1111for base_url in https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt ; do
12+ if [ ! -f /tmp/trackers.txt ]; then
13+ curl -o " /tmp/trackers.txt" " ${base_url} "
14+ fi
15+ Local=$( wc -c < /tmp/trackers.txt)
16+ Remote=$( curl -sI " ${base_url} " | awk ' /Content-Length/ {sub("\r",""); print $2}' )
17+ if [ $Local != $Remote ]; then
18+ curl -o " /tmp/trackers.txt" " ${base_url} "
19+ fi
1220 echo " URL for ${base_url} "
1321 echo " Adding trackers for $torrent_name ..."
14- for tracker in $( curl -# " ${base_url} " ) ; do
22+ for tracker in $( cat /tmp/trackers.txt ) ; do
1523 echo -n " ${tracker} ..."
1624if transmission-remote " $host " --auth=" $auth " --torrent " ${torrent_hash} " -td " ${tracker} " | grep -q ' success' ; then
1725 echo ' failed.'
2432 rm -f /tmp/TTAA.$id .lock
2533}
2634# Get list of active torrents
27- ids=" $( transmission-remote " $host " --auth=" $auth " --list | grep -vE ' Seeding|Stopped|Finished' | grep ' ^ ' | awk ' { print $1 }' ) "
35+ ids=" $( transmission-remote " $host " --auth=" $auth " --list | grep -vE ' Seeding|Stopped|Finished|[[:space:]]100%[[:space:]] ' | grep ' ^ ' | awk ' { print $1 }' ) "
2836for id in $ids ; do
2937 add_date=" $( transmission-remote " $host " --auth=" $auth " --torrent " $id " --info| grep ' ^ Date added: ' | cut -c 21-) "
3038 add_date_t=" $( date -d " $add_date " " +%Y-%m-%d %H:%M" ) "
You can’t perform that action at this time.
0 commit comments