[linux & BSD] WWE Post Processing
Posted: April 24th, 2012, 12:18 am
Soooo since thetvdb.com stopped updating WWE shows back in january I have been searching for the best way to keep it up to date with minimal effort.
I am a complete beginner at scripting but I did my best and what I have works for me so I thought I'd share it with other WWE fans.
I have created an RSS feed from nzb matrix that searches for specific files. i.e. (WWE Monday Night Raw 2012 04 09 HDTV x264 RUDOS NZB) it limits results to HDTV x264 RUDOS, then in sabs rss options I set filters for RAW and SmackDown, then runs a script. I have a specific catagory setup for wrestling so it downloads to a specific location as not to interfere with other downloads. I run sabnzbd on my freenas server so some of the scripting is different and commented out for GNU use. (I made it on ubuntu and move it to my server). The commands to change the date types are different for linux and BSD so that's why there is part commented out. I could probably clean it up a bit but it works as is.
Also I have added a script to notify prowl as it doesn't get sent via sick beard.
prowl.sh
Thanks for looking
Any questions feel free to ask
I am a complete beginner at scripting but I did my best and what I have works for me so I thought I'd share it with other WWE fans.
I have created an RSS feed from nzb matrix that searches for specific files. i.e. (WWE Monday Night Raw 2012 04 09 HDTV x264 RUDOS NZB) it limits results to HDTV x264 RUDOS, then in sabs rss options I set filters for RAW and SmackDown, then runs a script. I have a specific catagory setup for wrestling so it downloads to a specific location as not to interfere with other downloads. I run sabnzbd on my freenas server so some of the scripting is different and commented out for GNU use. (I made it on ubuntu and move it to my server). The commands to change the date types are different for linux and BSD so that's why there is part commented out. I could probably clean it up a bit but it works as is.
Also I have added a script to notify prowl as it doesn't get sent via sick beard.
Code: Select all
#!/usr/local/bin/bash
cd "$1"
DIRPATHOLD=`pwd`
EXT=".mp4"
SCRIPTPATH="/mnt/utilities/downloaders/SickBeard/autoProcessTV/"
ID="1"
if [ "`ls * | grep -iv sample | grep WWE`" = "`ls * | grep -iv sample | grep Monday`" ]
then
DATE="20120102"
DIRPATH="/mnt/lukesNAS/TV*Shows/*Monday*Night*/*17/"
SERIES="WWE Monday Night RAW"
REMOVE="*Monday*Night*"
SEASON="17"
DATESEC=`date -j -f "%Y%m%d" "$DATE" "+%s"` #BSD formatted
#DATESEC=`date -d "$DATE" "+%s"` #linux formatted
FILE=`ls *$EXT | grep -iv sample`
FILEEDIT=`ls *$EXT | grep -iv sample | sed 's/WWE.Monday.Night.Raw.//g' | sed 's/.x264-RUDOS.mp4//g' | sed 's/[A-Za-z.]//g'`
else
DATE="20120106"
DIRPATH="/mnt/lukesNAS/TV*Shows/*Friday*Night*/*13/"
SERIES="WWE Friday Night SmackDown"
REMOVE="*Friday*Night*"
SEASON="13"
DATESEC=`date -j -f "%Y%m%d" "$DATE" "+%s"` #BSD formatted
#DATESEC=`date -d "$DATE" "+%s"` #linux formatted
FILE=`ls *$EXT | grep -iv sample`
FILEEDIT=`ls *$EXT | grep -iv sample | sed 's/WWE.Friday.Night.Smackdown.//g' | sed 's/.x264-RUDOS.mp4//g' | sed 's/[A-Za-z.]//g'`
fi
AIRED=`date -j -f "%Y%m%d" "$FILEEDIT" "+%Y-%m-%d"` #BSD formatted
AIREDSEC=`date -j -f "%Y%m%d" "$FILEEDIT" "+%s"` #BSD formatted
#AIRED=`date -d "$FILEEDIT" "+%Y-%m-%d"` #Linux formatted
#AIREDSEC=`date -d "$FILEEDIT" "+%s"` #Linux formatted
DIFF=$(((($AIREDSEC - $DATESEC)/(60*60*24*7))+1))
for ((i=0; i<$DIFF; i++))
do
ID=$(($ID+1))
done
export NEWFILE="$SERIES - "${SEASON}"x"${ID}" - ${AIRED}${EXT}"
mv "$FILE" $DIRPATH
cd $DIRPATH
mv "$FILE" "$NEWFILE"
cd "$DIRPATHOLD"
cd ..
rm -r "$REMOVE"
sh ${SCRIPTPATH}prowl.sh
exit 0
Code: Select all
#!/usr/local/bin/bash
APIKEY="XXXXXXXXXXXXXXXXX"
APP="Download Finished"
/mnt/utilities/downloaders/curl/bin/curl -s -k https://prowl.weks.net/publicapi/add -F apikey=$APIKEY -F application="$APP" -F description="$NEWFILE"
exit 0