Fixes for WolfPack to use new headers

This commit is contained in:
cxford 2016-08-30 14:00:45 -05:00
parent d0b1596515
commit ecb464af55
2 changed files with 4 additions and 48 deletions

View File

@ -1,6 +1,5 @@
torrentengine="https://1337x.to/search/%s/1/"
torrentterms='printf https://1337x.to; grep "/torrent/" | head -n 1 | cut -f 2 -d \"'
torrentengine=https://1337x.to/search/%s/1/
torrentterms=printf https://1337x.to; grep "/torrent/" | head -n 1 | cut -f 2 -d \"
magnetposition=4
torrentdebugging="false"
searchunifier="+"
torrentdebugging=true
searchunifier=+

View File

@ -2,47 +2,6 @@
source /usr/local/src/SharedLibraries/Bash/header
# Configure the torrenting engine.
function configuretorrent {
if [ ! -f "$1" ]; then
errorheader "Torrent configuration file not found."
exit 1;
fi
param "$1" torrentengine
param "$1" torrentterms
param "$1" magnetposition
param "$1" torrentdebugging
param "$1" searchunifier
}
# Get a magnet link for downloads.
function getmagnetlink {
if [ -z "$1" ]; then
errorheader "Need search terms";
exit 1;
fi
if [ -z "$torrentengine" ] || [ -z "$searchlink" ]; then
errorheader Torrent not configured.
fi
export searchstring="$(echo "$1" | sed "s/ /$searchunifier/g")"
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
}
function torrentlink {
if [ ! -z "$magnetlink" ]; then
/usr/bin/transmission-cli -d 1000 -u 1 -er -w "$downloaddir" -b -f "/usr/local/bin/wolfpack-stoptorrent" "$magnetlink"
rm -Rf ~/.config/transmission/resume/*
rm -Rf ~/.config/transmission/torrents/*
fi
}
# Logging
export logfile='/var/log/wolfpack.log'
@ -107,8 +66,6 @@ function torrent {
done
}
function shows {
if [ "$1" == "" ] || [ $(wc -l "$1" | cut -f 1 -d ' ') -lt 3 ]; then
echo "Need a valid argument."