Adding date/time show tracking under new function, error tracking for critical functions
This commit is contained in:
parent
02ab50f585
commit
05b4439b61
@ -1,6 +1,6 @@
|
|||||||
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 10 -d \"
|
torrentterms=printf https://1337x.to; grep "/torrent/" | head -n 1 | cut -f 10 -d \"
|
||||||
magnetposition=4
|
magnetposition=4
|
||||||
torrentdebugging=true
|
torrentdebugging=false
|
||||||
searchunifier=+
|
searchunifier=+
|
||||||
magnetseparator="
|
magnetseparator="
|
||||||
|
@ -15,3 +15,5 @@ fi
|
|||||||
|
|
||||||
header Getting magnet link.
|
header Getting magnet link.
|
||||||
getmagnetlink "$(echo $1 | tr '#' "$searchunifier")"
|
getmagnetlink "$(echo $1 | tr '#' "$searchunifier")"
|
||||||
|
echo
|
||||||
|
echo Found: $magnetlink
|
||||||
|
6
torrentdownloads.torrentengine.sample
Normal file
6
torrentdownloads.torrentengine.sample
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
torrentengine=https://www.torrentdownloads.me/search/?search=%s
|
||||||
|
torrentterms=printf https://www.torrentdownloads.me/; grep "/torrent/" | head -n 1 | cut -f 78 -d \"
|
||||||
|
magnetposition=4
|
||||||
|
torrentdebugging=false
|
||||||
|
searchunifier=+
|
||||||
|
magnetseparator="
|
@ -1,6 +1,6 @@
|
|||||||
torrentengine=http://torrentproject.se/?t=%s
|
torrentengine=http://torrentproject.se/?t=%s
|
||||||
torrentterms=printf http://torrentproject.se; grep "verified" | head -n 1 | cut -f 2 -d \' | head -n 1
|
torrentterms=printf http://torrentproject.se; grep "verified" | head -n 1 | cut -f 2 -d \' | head -n 1
|
||||||
magnetposition=2
|
magnetposition=2
|
||||||
torrentdebugging=true
|
torrentdebugging=false
|
||||||
searchunifier=+
|
searchunifier=+
|
||||||
magnetseparator='
|
magnetseparator='
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
torrentengine=https://thepiratebay.org/search/%s/0/99/0/
|
torrentengine=https://thepiratebay.org/search/%s/0/99/0/
|
||||||
torrentterms=printf https://thepiratebay.org; grep "/torrent/" | head -n 1 | cut -f 4 -d \"
|
torrentterms=printf https://thepiratebay.org; grep "/torrent/" | head -n 1 | cut -f 4 -d \"
|
||||||
magnetposition=4
|
magnetposition=4
|
||||||
torrentdebugging=true
|
torrentdebugging=false
|
||||||
searchunifier=%20
|
searchunifier=%20
|
||||||
magnetseparator="
|
magnetseparator="
|
||||||
|
49
wolfpack
49
wolfpack
@ -1,7 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source /usr/local/src/SharedLibraries/Bash/header
|
source /usr/local/src/SharedLibraries/Bash/header
|
||||||
|
if [ -z "$3" ]; then
|
||||||
configuretorrent /usr/local/etc/WolfPack/torrentengine
|
configuretorrent /usr/local/etc/WolfPack/torrentengine
|
||||||
|
else
|
||||||
|
configuretorrent "$3"
|
||||||
|
fi
|
||||||
export IFS="
|
export IFS="
|
||||||
"
|
"
|
||||||
export logfile='/var/log/wolfpack.log'
|
export logfile='/var/log/wolfpack.log'
|
||||||
@ -15,12 +18,11 @@ function helptext {
|
|||||||
// /~_____/ with their prey.
|
// /~_____/ with their prey.
|
||||||
/// \\/ / ~dev@aninix.net
|
/// \\/ / ~dev@aninix.net
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
wolfpack --alpha ~~ Tell the alpha to send the
|
wolfpack --alpha [enginefile] ~~ Tell the alpha to send the
|
||||||
pack members hunting.
|
pack members hunting.
|
||||||
wolfpack --member <pup> ~~ Send a member to train a pup
|
wolfpack --member <pup> [enginefile] ~~ Send a member to train a pup
|
||||||
and bring back results.
|
and bring back results.
|
||||||
wolfpack --stop-torrent ~~ Stop any transmission-cli
|
wolfpack --help ~~ Show this helptext
|
||||||
processes
|
|
||||||
|
|
||||||
Available pup types (all pups are line-delimited with the type and
|
Available pup types (all pups are line-delimited with the type and
|
||||||
result location as the first two lines):
|
result location as the first two lines):
|
||||||
@ -45,11 +47,20 @@ function helptext {
|
|||||||
|
|
||||||
function privacycheck {
|
function privacycheck {
|
||||||
if [ "$(whatismyip)" == "$(nslookup aninix.net | grep Address | cut -f 2 -d ' ' | tail -n 1)" ]; then
|
if [ "$(whatismyip)" == "$(nslookup aninix.net | grep Address | cut -f 2 -d ' ' | tail -n 1)" ]; then
|
||||||
echo "Should not torrent directly from the AniNIX main IP for privacy reasons" 2>&1 | tee -a $logfile
|
echo "ERROR: Should not torrent directly from the AniNIX main IP for privacy reasons" 2>&1 | tee -a $logfile
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nextairdate {
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Need a show to search for"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
wget -q -O - https://www.episodate.com/tv-show/"$(echo $1 | sed 's/[ \t]*$//' | sed 's/^[ \t]*//' | tr ' ' '-' | tr '[:upper:]' '[:lower:]')"?season=99 | tr '>' '\n' | grep episode_datetime_convert | head -n 1 | cut -f 4 -d \" | cut -f 1 -d 'T'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
function transmissioncheck {
|
function transmissioncheck {
|
||||||
if [ "$(pgrep -afc transmission-cli)" -ne 0 ]; then
|
if [ "$(pgrep -afc transmission-cli)" -ne 0 ]; then
|
||||||
echo "Transmission is still running. Aborting." | tee -a $logfile
|
echo "Transmission is still running. Aborting." | tee -a $logfile
|
||||||
@ -90,12 +101,13 @@ function shows {
|
|||||||
echo "Would download to "$downloaddir
|
echo "Would download to "$downloaddir
|
||||||
for i in $(tail -n +3 "$1"); do
|
for i in $(tail -n +3 "$1"); do
|
||||||
getmagnetlink "$(echo $i | tr '#' "$searchunifier")"
|
getmagnetlink "$(echo $i | tr '#' "$searchunifier")"
|
||||||
export sepisode=$(echo $i | cut -f 1 -d '#')
|
sepisode=$(echo $i | cut -f 1 -d '#')
|
||||||
export searchterms="$(echo $i | cut -f 2 -d '#')"
|
showName="$(echo $i | cut -f 2 -d '#')"
|
||||||
export season=$(echo $sepisode | cut -f 1 -d 'E' | cut -f 2 -d 'S')
|
searchterms="$showName"' '"$(echo $i | cut -f 2 -d '#')"
|
||||||
export episode=$(echo $sepisode | cut -f 2 -d 'E')
|
season=$(echo $sepisode | cut -f 1 -d 'E' | cut -f 2 -d 'S')
|
||||||
export newep=$(printf "%02d\n" $((${episode#0} + 1)))
|
episode=$(echo $sepisode | cut -f 2 -d 'E')
|
||||||
export newseason="$(printf "%02d\n" $((${season#0} + 1)))"
|
newep=$(printf "%02d\n" $((${episode#0} + 1)))
|
||||||
|
newseason="$(printf "%02d\n" $((${season#0} + 1)))"
|
||||||
if [ "$magnetlink" != "" ]; then
|
if [ "$magnetlink" != "" ]; then
|
||||||
# We found an episode.
|
# We found an episode.
|
||||||
echo $i | tee -a $logfile
|
echo $i | tee -a $logfile
|
||||||
@ -115,7 +127,15 @@ function shows {
|
|||||||
/usr/bin/transmission-cli -d 600 -u 1 -er -w "$downloaddir" -b -f "/usr/local/bin/wolfpack-stoptorrent" "$magnetlink"
|
/usr/bin/transmission-cli -d 600 -u 1 -er -w "$downloaddir" -b -f "/usr/local/bin/wolfpack-stoptorrent" "$magnetlink"
|
||||||
sed -i "s/$i/S"$newseason"E01#"$searchterms"/" "$1"
|
sed -i "s/$i/S"$newseason"E01#"$searchterms"/" "$1"
|
||||||
else
|
else
|
||||||
echo "No new season found for $searchterms" | tee -a $logfile
|
nextAirDate="$(nextairdate "$showName")"
|
||||||
|
if [ ! -z "$nextAirDate" ]; then
|
||||||
|
echo "No new season found for $showName -- next airs $(nextairdate "$showName")" | tee -a $logfile
|
||||||
|
if [ "$(date -s "$nextAirDate" -u +%s)" -lt "$(date -u +%s)" ]; then
|
||||||
|
echo ERROR: Should have found a new episode for $searchterms and did not -- check your provider\! | tee -a $logfile
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No new season found for $showName" | tee -a $logfile
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -164,7 +184,6 @@ function search {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
helptext;
|
helptext;
|
||||||
exit 1;
|
exit 1;
|
||||||
@ -182,7 +201,7 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
echo "Starting members from pup in "$basedir | tee -a $logfile
|
echo "Starting members from pup in "$basedir | tee -a $logfile
|
||||||
for i in $(find "$basedir" -type f | grep '.pup'); do
|
for i in $(find "$basedir" -type f | grep '.pup'); do
|
||||||
/usr/local/bin/wolfpack --member "$i";
|
/usr/local/bin/wolfpack --member "$i" "$3";
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user