Fixes for WolfPack to use new headers
This commit is contained in:
parent
d0b1596515
commit
ecb464af55
@ -1,6 +1,5 @@
|
|||||||
torrentengine="https://1337x.to/search/%s/1/"
|
torrentengine=https://1337x.to/search/%s/1/
|
||||||
torrentterms='printf https://1337x.to; grep "/torrent/" | head -n 1 | cut -f 2 -d \"'
|
torrentterms=printf https://1337x.to; grep "/torrent/" | head -n 1 | cut -f 2 -d \"
|
||||||
magnetposition=4
|
magnetposition=4
|
||||||
torrentdebugging="false"
|
torrentdebugging=true
|
||||||
searchunifier="+"
|
searchunifier=+
|
||||||
|
|
||||||
|
43
wolfpack
43
wolfpack
@ -2,47 +2,6 @@
|
|||||||
|
|
||||||
source /usr/local/src/SharedLibraries/Bash/header
|
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
|
# Logging
|
||||||
export logfile='/var/log/wolfpack.log'
|
export logfile='/var/log/wolfpack.log'
|
||||||
|
|
||||||
@ -107,8 +66,6 @@ function torrent {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function shows {
|
function shows {
|
||||||
if [ "$1" == "" ] || [ $(wc -l "$1" | cut -f 1 -d ' ') -lt 3 ]; then
|
if [ "$1" == "" ] || [ $(wc -l "$1" | cut -f 1 -d ' ') -lt 3 ]; then
|
||||||
echo "Need a valid argument."
|
echo "Need a valid argument."
|
||||||
|
Loading…
Reference in New Issue
Block a user