From ecb464af55f52973920189a39d79a36e693c1153 Mon Sep 17 00:00:00 2001 From: cxford Date: Tue, 30 Aug 2016 14:00:45 -0500 Subject: [PATCH] Fixes for WolfPack to use new headers --- 1337x.torrentengine.sample | 9 ++++---- wolfpack | 43 -------------------------------------- 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/1337x.torrentengine.sample b/1337x.torrentengine.sample index 559d0f5..4f9ceef 100644 --- a/1337x.torrentengine.sample +++ b/1337x.torrentengine.sample @@ -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=+ diff --git a/wolfpack b/wolfpack index 5df2fa2..1d4394f 100755 --- a/wolfpack +++ b/wolfpack @@ -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."