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 () {
9
9
torrent_hash=$1
10
10
id=$2
11
11
for 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
12
20
echo " URL for ${base_url} "
13
21
echo " Adding trackers for $torrent_name ..."
14
- for tracker in $( curl -# " ${base_url} " ) ; do
22
+ for tracker in $( cat /tmp/trackers.txt ) ; do
15
23
echo -n " ${tracker} ..."
16
24
if transmission-remote " $host " --auth=" $auth " --torrent " ${torrent_hash} " -td " ${tracker} " | grep -q ' success' ; then
17
25
echo ' failed.'
24
32
rm -f /tmp/TTAA.$id .lock
25
33
}
26
34
# 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 }' ) "
28
36
for id in $ids ; do
29
37
add_date=" $( transmission-remote " $host " --auth=" $auth " --torrent " $id " --info| grep ' ^ Date added: ' | cut -c 21-) "
30
38
add_date_t=" $( date -d " $add_date " " +%Y-%m-%d %H:%M" ) "
You can’t perform that action at this time.
0 commit comments