-
Notifications
You must be signed in to change notification settings - Fork 0
/
torrentcahedownloader
31 lines (27 loc) · 1.62 KB
/
torrentcahedownloader
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
#!/bin/bash
#set -ex
# Script to download torrent files from torrent caches. Input torrent hash as a parameter of this script
if [ "$1" == "" ];then echo "Please run this script like: scriptname torrenthash" && exit;fi
hash="$1"
thisscriptdir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
tmpdir="$thisscriptdir/tmp"
mkdir "$tmpdir" 2>/dev/null
if [[ "$(grep -c length "$tmpdir"/"$hash".torrent 2>/dev/null)" == "" ]];then
wget -O "$tmpdir"/"$hash".torrent --timeout 10 --max-redirect=10 --no-check-certificate http://itorrents.org/torrent/"$hash".torrent
fi
if [[ "$(grep -c length "$tmpdir"/"$hash".torrent 2>/dev/null)" == "" ]];then
wget -O "$tmpdir"/"$hash".torrent --timeout 10 --max-redirect=10 --no-check-certificate http://torrage.info/torrent.php?h="$hash"
fi
if [[ "$(grep -c length "$tmpdir"/"$hash".torrent 2>/dev/null)" == "" ]];then
wget -O "$tmpdir"/"$hash".torrent --timeout 10 --max-redirect=10 --no-check-certificate http://btcache.me/torrent/"$hash"
fi
if [[ "$(grep -c length "$tmpdir"/"$hash".torrent 2>/dev/null)" == "" ]];then
wget -O "$tmpdir"/"$hash".torrent --timeout 10 --max-redirect=10 --no-check-certificate http://torrasave.download/torrent/"$hash".torrent
fi
if [[ "$(grep -c length "$tmpdir"/"$hash".torrent 2>/dev/null)" == "" ]];then
wget -O "$tmpdir"/"$hash".torrent --timeout 10 --max-redirect=10 --no-check-certificate http://thetorrent.org/"$hash".torrent
fi
if [[ "$(grep -c length "$tmpdir"/"$hash".torrent 2>/dev/null)" == "" ]];then
wget -O "$tmpdir"/"$hash".torrent --timeout 10 --max-redirect=10 --no-check-certificate http://thetorrent.to/"$hash".torrent
fi
#find "$tmpdir" -type f -mtime +24 -delete