Fixes and stability
This commit is contained in:
parent
f2864631fb
commit
e60037ee0e
1
Makefile
1
Makefile
@ -12,7 +12,6 @@ configure:
|
||||
install: /usr/bin/wget /usr/bin/transmission-cli /usr/bin/googler wolfpack wolfpack-stoptorrent /usr/local/bin/whatismyip
|
||||
cp -p /usr/local/src/WolfPack/wolfpack /usr/local/bin/wolfpack
|
||||
cp -p /usr/local/src/WolfPack/wolfpack-stoptorrent /usr/local/bin/wolfpack-stoptorrent
|
||||
[ ! -f /root/.bashrc ] || (grep 'transmission-cli' /root/.bashrc) || echo 'alias transmission-cli="transmission-cli -d 600 -u 1 -er -w /srv/yggdrasil/new_acquisition -b"' >> /root/.bashrc
|
||||
chmod 0700 /usr/local/bin/wolfpack-stoptorrent
|
||||
chmod 0755 /usr/local/bin/wolfpack
|
||||
chown root:root /usr/local/bin/wolfpack*
|
||||
|
38
wolfpack
38
wolfpack
@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
export IFS="
|
||||
"
|
||||
|
||||
export torrentengine="https://1337x.to/search/%s/1/"
|
||||
export torrentterms='printf https://1337x.to; grep "/torrent/" | head -n 1 | cut -f 2 -d \"'
|
||||
export magnetposition=4
|
||||
export torrentdebugging="false"
|
||||
export logfile='/var/log/wolfpack.log'
|
||||
|
||||
function helptext {
|
||||
@ -54,11 +56,18 @@ function torrent {
|
||||
fi
|
||||
for i in $(tail -n +3 "$1"); do
|
||||
export searchstring="$(echo $i | sed 's/ /+/g')"
|
||||
export searchlink="http://torrentproject.org/?t=""$searchstring"
|
||||
export searchresult=$(wget -q -O - "$searchlink" | grep torrentproject.org | grep '<div><span><a href=' | cut -f 2 -d \')
|
||||
export magnetlink=$(wget -q -O - "$searchresult" | grep 'magnet:?' | cut -f 2 -d \')
|
||||
export searchlink="$(printf "$torrentengine" "$searchstring")"
|
||||
export searchresult=$(wget -q -O - "$searchlink" | bash -c "$torrentterms")
|
||||
export magnetlink=$(wget -q -O - "$searchresult" | grep 'magnet:?' | cut -f $magnetposition -d \")
|
||||
if [ $torrentdebugging == "true" ]; then
|
||||
echo $searchstring
|
||||
echo $searchlink
|
||||
echo $searchresult
|
||||
echo $magnetlink
|
||||
read
|
||||
fi
|
||||
if [ "$magnetlink" != "" ]; then
|
||||
/usr/bin/transmission-cli -d 600 -u 1 -er -w "$downloaddir" -b -f "/usr/local/bin/wolfpack-stoptorrent" "$magnetlink"
|
||||
/usr/bin/transmission-cli -d 1000 -u 1 -er -w "$downloaddir" -b -f "/usr/local/bin/wolfpack-stoptorrent" "$magnetlink"
|
||||
sed -i "/$i/d" "$1"
|
||||
echo Downloaded and removed $i | tee -a $logfile
|
||||
fi
|
||||
@ -80,9 +89,16 @@ function shows {
|
||||
echo "Would download to "$downloaddir
|
||||
for i in $(tail -n +3 "$1"); do
|
||||
export searchsegment="$(echo $i | tr '#' '+' | tr ' ' '+')"
|
||||
export searchlink="http://torrentproject.org/?t=""$searchsegment"
|
||||
export searchresult=$(wget -q -O - "$searchlink" | grep torrentproject.org | grep '<div><span><a href=' | cut -f 2 -d \')
|
||||
export magnetlink=$(wget -q -O - "$searchresult" | grep 'magnet:?' | cut -f 2 -d \')
|
||||
export searchlink="$(printf "$torrentengine" "$searchsegment")"
|
||||
export searchresult=$(wget -q -O - "$searchlink" | bash -c "$torrentterms")
|
||||
export magnetlink=$(wget -q -O - "$searchresult" | grep 'magnet:?' | cut -f $magnetposition -d \")
|
||||
if [ $torrentdebugging == "true" ]; then
|
||||
echo $searchstring
|
||||
echo $searchlink
|
||||
echo $searchresult
|
||||
echo $magnetlink
|
||||
read
|
||||
fi
|
||||
if [ "$magnetlink" != "" ]; then
|
||||
# We found an episode.
|
||||
echo $i >> $logfile
|
||||
@ -107,8 +123,8 @@ function shows {
|
||||
export episode=$(echo $sepisode | cut -f 2 -d 'E')
|
||||
export newseason=$(printf "%02d\n" $((${season#0} + 1)))
|
||||
export newsearch="$(echo $searchlink | sed 's/S'$season'E'$episode'/S'$newseason'E01/')"
|
||||
export searchresult=$(wget -q -O - "$newsearch" | grep torrentproject.org | grep '<div><span><a href=' | cut -f 2 -d \')
|
||||
export magnetlink=$(wget -q -O - "$searchresult" | grep 'magnet:?' | cut -f 2 -d \')
|
||||
export searchresult=$(wget -q -O - "$newsearch" | bash -c "$torrentterms")
|
||||
export magnetlink=$(wget -q -O - "$searchresult" | grep 'magnet:?' | cut -f $magnetposition -d \")
|
||||
if [ "$magnetlinki" != "" ]; then
|
||||
echo "S"$newseason"E01" $searchterms >> $logfile
|
||||
/usr/bin/transmission-cli -d 600 -u 1 -er -w "$downloaddir" -b -f "/usr/local/bin/wolfpack-stoptorrent" "$magnetlink"
|
||||
|
Loading…
Reference in New Issue
Block a user