-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdme.sh
executable file
·38 lines (33 loc) · 1.2 KB
/
dme.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# collect referers
wget -qO- http://rutracker.org/forum/viewtopic.php?t=3242662 --load-cookies rt.cookie | grep \<a\ href\=\"http\:\/\/rutracker\.org\/forum\/viewtopic\.php\?t\=[^\"]*\"\ class=\"postLink\" -o | grep http:\/\/[^\"]* -o > referers
# collect links on torrents
cat referers | sed 's/[^=]*=\([0-9]*\)/http\:\/\/dl\.rutracker\.org\/forum\/dl\.php\?t=\1/' > links
# collect POST parameters
cat links | sed 's/[^=]*=\([0-9]*\)/\1/' > posts
# making referers array
i=0
while read line; do
referers[$i]="$line"
i=$(($i+1))
done < referers
# making links array
i=0
while read line; do
links[$i]="$line"
i=$(($i+1))
done < links
# making posts array
i=0
while read line; do
posts[$i]="$line"
i=$(($i+1))
done < posts
# downloading torrents
for ((i=0; i<${#links[*]}; i++))
do
wget "${links[$i]}" -P ./torrents/ --load-cookies rt.cookie --referer="${referers[$i]}" --header="Content-Type: application/x-www-form-urlencoded" --post-data="t=${posts[$i]}"
done
#transmission-remote 192.168.1.12:9091 --auth=user:pa\$\$w0rd -a ./torrents/* - not working for me
# starting downloads on remote transmission
find ./torrents/ -name dl.* -exec transmission-remote 192.168.1.12:9091 --auth=user:pa\$\$w0rd -a {} \;