WWE Raw and Smackdown
#16
Here is a further updated version, I just combined the scripts so it generates the NFO file as well. So ignore the NFO script that is in the earlier posts.

So, raw and smackdown, from any provider. it should work.

wrestling_mac.sh
Code:
Depreciated
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#17
Great work thanks.

Im obviously being a nugget as the scripts didnt run for this weeks Raw. Error message:

Exit(-1) Cannot run script /Users/brian_keith/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh (More)

Here is what Ive done.Ive created the above code and placed the file into:

~/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh

in terminal ran the command:

chmod +x ~/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh

Folder structure is:

/media files/WWE/Raw
/media files/WWE/Smackdown

These have been added to your code in the DIRPATH

sabnzb RSS feed, finds and downloads episodes with the following:

Category = wwe raw; priority=default; processing=+delete; scripts=wrestling_mac.sh; folder =/media files/WWE/RAW;

Ive also got a seperate category for smackdown, which is the same as above except fopr the folder

Sab is downloading the files ok and extracting them to their associated directory (ie /media files/WWE/RAW/show date/....mkv)

Any ideas on what Im doing wrong? would love to get this up and running

Reply
#18
ok getting somewhere now......The code was missing the ! from the beggining....
Still not running....

Failed conversion of ``'' using format ``%Y%m%d''
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Failed conversion of ``'' using format ``%Y%m%d''
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
touch: /macintosh HD/media files/WWE/RAW//WWE Monday Night RAW - 17x1 - .nfo: No such file or directory
/Users/brian_keith/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh: line 75: /macintosh HD/media files/WWE/RAW//WWE Monday Night RAW - 17x1 - .nfo: No such file or directory
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
/Users/brian_keith/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh: line 86: cd: /macintosh: No such file or directory
mv: rename to WWE Monday Night RAW - 17x1 - .: No such file or directory
rm: *raw*: No such file or directory
Reply
#19
Failed conversion of ``'' using format ``%Y%m%d''
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Failed conversion of ``'' using format ``%Y%m%d''
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
/Users/brian_keith/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh: line 86: cd: /media: No such file or directory
mv: rename to WWE Monday Night RAW - 17x1 - .: No such file or directory
Reply
#20
You might want to make a separate directory for your downloads, just a generic folder "wrestling" or whatever, and have SAB download the files to there, because this script moves the files and renames them. You seem to download them to their specific directory from SAB.

Quote: Failed conversion of ``'' using format ``%Y%m%d''
means that it didn't find a date. Strange.

So just make an arbitrary download folder then point sab to download your wrestling files to there.

Also, you can always test the script by cd into the directory that the file downloaded to (you have to be inside the folder so you can see the file) then test run the script via
Code:
bash /path/to/script/wrestling_mac.sh
this may be easier to do instead of downloading the file each time.

Here is a new version of the script, it will exit if it does not find a proper date. Also, I have commented out the rm function at the bottom until we get it sorted out.

wrestling_mac.sh
Code:
Depreciated
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#21
ok, Ive updated the categories to not got to the destination. The script has made the nfo in the destination folder, although its not moved the actual video file

usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
/Users/brian_keith/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh: line 84: cd: /media: No such file or directory
Reply
#22
mv "$FILE" $DIRPATH

Updated to

mv "$FILE" "$DIRPATH"

Gets me moving forward again, nfo and file are moving into destination directory which is brilliant :-) Rename of video file not working at the moment..will report back if I find anything

/Users/brian_keith/Library/Application Support/SABnzbd/scripts/wrestling_mac.sh: line 84: cd: /media: No such file or directory
mv: rename wwe.raw.2012.06.18.hdtv.x264-kyr.mp4 to WWE Monday Night RAW - 17x25 - 2012-06-18.mp4: No such file or directory

Reply
#23
All working now, many thanks go out to lrusak for this

Final update to get working:

mv "$FILE" $DIRPATH
cd "$DIRPATH"
mv "$FILE" "$NEWFILE"
Reply
#24
(2012-06-20, 10:57)BrEEdAA Wrote: All working now, many thanks go out to lrusak for this

Final update to get working:

mv "$FILE" $DIRPATH
cd "$DIRPATH"
mv "$FILE" "$NEWFILE"

interesting find, I don't know why it worked on my macbook and not on yours, but I'm happy you got it working!

You can feel free to add anything to the part of the script where the NFO file is created. say if you want a general plot or actor thumbs or whatever, just remember it is for both raw and smackdown.

PS, I also have a prowl script I use with this so it notifys my phone when it downloads Big Grin

PS here is an updated version that will actually remove the folder after the file has been moved
Code:
#!/bin/bash

cd "$1"

DIRPATHOLD=`pwd`
FILE=`ls -S | grep wwe | awk 'NR==1{print $0}'`
EXT=`echo "$FILE" | awk -F. '{print $(NF-0)}'`
ID="1"

if [ "$FILE" = "`echo $FILE | grep raw`" ]
then

# First RAW of the Year (don't change until 2013)
DATE="20120102"

# Path to RAW episodes (MUST BE ABSOLUTE PATH!)
DIRPATH="/Users/lukas/Desktop/junk/WWE/test/"

# Name of RAW series (don't need to change)
SERIES="WWE Monday Night RAW"

# Season of Raw (don't change until 2013)
SEASON="17"

else

# First Smackdown of the Year (don't change until 2013)
DATE="20120106"

# Path to Smackdown episodes (MUST BE ABSOLUTE PATH!)
DIRPATH="/Users/lukas/Desktop/junk/WWE/test/"

# Name of Smackdown series (don't need to change)
SERIES="WWE Friday Night SmackDown"

# Season of Smackdown (don't change until 2013)
SEASON="13"

fi

# DO NOT TOUCH # from here
FILEEDIT=`echo "$FILE" | grep -o [0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9] | awk -F. '{print $1""$2""$3}'`

if [ -z "$FILEEDIT" ];
then
echo "file not found"
else

DATESEC=`date -j -f "%Y%m%d" "$DATE" "+%s"`        #BSD formatted
AIRED=`date -j -f "%Y%m%d" "$FILEEDIT" "+%Y-%m-%d"`    #BSD formatted
AIREDSEC=`date -j -f "%Y%m%d" "$FILEEDIT" "+%s"`    #BSD formatted

DIFF=$(((($AIREDSEC - $DATESEC)/(60*60*24*7))+1))

for ((i=0; i<$DIFF; i++))
do
     ID=$(($ID+1))
done

NEWFILE="$SERIES - "${SEASON}"x"${ID}" - ${AIRED}.${EXT}"
# DO NOT TOUCH # to here

#NFO file creation
NFO="$SERIES - "${SEASON}"x"${ID}" - $AIRED.nfo"
touch "$DIRPATH"/"$NFO"
echo "<episodedetails xsd="http://www.w3.org/2001/XMLSchema" xsi="http://www.w3.org/2001/XMLSchema-instance">
   <title>Episode ${ID}</title>
   <season>${SEASON}</season>
   <episode>${ID}</episode>
   <aired>${AIRED}</aired>
   <plot />
   <displayseason />
   <displayepisode />
   <thumb />
   <watched>false</watched>
   <credits />
   <director />
   <rating />
</episodedetails>" > "$DIRPATH"/"$NFO"

mv "$FILE" $DIRPATH
cd "$DIRPATH"
mv "$FILE" "$NEWFILE"

cd "$DIRPATHOLD"
cd ..

#Removes old folder (recommended)
rm -R "$1"
fi

# For testing purposes
#echo $FILE
#echo $EXT
#echo $FILEEDIT
#echo $NEWFILE
#echo $NFO

exit 0
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#25
Just found this thread, it's great that you've written a program that may help a few others. For me I just copy the previous .nfo and edit it manually, I prefer to have a greater degree of control over the contents. It's only one or two a week so only takes a couple of minutes.

How are you storing them on XBMC currently? Am working on an update to my tutorial (see signature), I always like to get a fresh pair of eyes on it incase anyone else can bring some ideas or changes to the table. Anyway, good work Wink
Reply
#26
(2012-06-20, 19:00)Deano316 Wrote: Just found this thread, it's great that you've written a program that may help a few others. For me I just copy the previous .nfo and edit it manually, I prefer to have a greater degree of control over the contents. It's only one or two a week so only takes a couple of minutes.
Well you could just use my NFO generator on page 1 of this thread to make all the NFO's for raw and smackdown for this year if you wanted to.

The main reason I wanted to do this is because they used to download automaticlly through sickbeard before theTVDB dropped the show. So I wanted to add that functionality back again the best I could. Plus it was fun for me to learn how to use some function in bash and the script has developed a long way from where it began. It's just so nice to wakeup the next morning and see that raw or smackdown has downloaded already and all I have to do is update my xbmc library Smile

I do still do the PPV's manually though because they are once a week.

(2012-06-20, 19:00)Deano316 Wrote: How are you storing them on XBMC currently? Am working on an update to my tutorial (see signature), I always like to get a fresh pair of eyes on it incase anyone else can bring some ideas or changes to the table. Anyway, good work Wink

I just store them in my tv shows folder

TV Shows
------> WWE Monday Night RAW
---------------> Season 17
------------------------> WWE Monday Night Raw - 17x25 - 2012-06-18.mp4
------------------------> WWE Monday Night Raw - 17x25 - 2012-06-18.nfo


The only thing I am missing is some more fanart. The stuff on thetvdb is old and poor. I'd like to find some newer stuff if you could point me in the right direction Smile
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#27
Check the tutorial, shows you where to find more. I will be updating it shortly, found a few new tricks for displaying some great fanart Wink As soon as I've freed up some space, I'll be giving you NFO Generator a go. If you're short any fanart or logos, let me know. I've found a few different sites that have some. Big Grin
Reply
#28
(2012-06-20, 19:00)Deano316 Wrote: How are you storing them on XBMC currently? Am working on an update to my tutorial (see signature), I always like to get a fresh pair of eyes on it incase anyone else can bring some ideas or changes to the table. Anyway, good work Wink

I've still got raw & smackdown listed in sickbeard, so I'm just pointing this script to the folders it used to use:

/media files/tv/wwe monday night raw/

PPV are still manual

Reply
#29
I noticed the xbmc libray was updating, although on my setup the video titles were not coming through for some reason. Ive edited the script so that the files are just created as:

WWE Monday Night Raw SxxExx

Dropping the air date, and this is now populating titles in my library. Ive included my amended code, should anyone be interested:

Next stop, send an update xbmc library command upson completion :-)

PHP Code:
#!/bin/bash

cd "$1"

DIRPATHOLD=`pwd`
FILE=`ls -S | grep wwe | awk 'NR==1{print $0}'`
EXT=`echo "$FILE" | awk -F. '{print $(NF-0)}'`
ID="1"

if [ "$FILE"`echo $FILE | grep raw`" ]
then

# First RAW of the Year (don't change until 2013)
DATE="20120102"

# Path to RAW episodes (MUST BE ABSOLUTE PATH!)
DIRPATH="/media files/Tv/WWE Monday Night RAW/"

# Name of RAW series (don't need to change)
SERIES="WWE Monday Night RAW"
REMOVE="*raw*"

# Season of Raw (don't change until 2013)
SEASON="17"

else

# First Smackdown of the Year (don't change until 2013)
DATE="20120106"

# Path to Smackdown episodes (MUST BE ABSOLUTE PATH!)
DIRPATH="/media files/Tv/WWE Friday Night Smackdown/"

# Name of Smackdown series (don't need to change)
SERIES="WWE Friday Night SmackDown"
REMOVE="*smackdown*"

# Season of Smackdown (don't change until 2013)
SEASON="13"

fi

# DO NOT TOUCH # from here
FILEEDIT=`echo "$FILE" | grep -o [0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9] | awk -F. '{print $1""$2""$3}'`

if [ -
"$FILEEDIT];
then
echo "file not found"
else

DATESEC=`date -j -f "%Y%m%d" "$DATE" "+%s"`        #BSD formatted
AIRED=`date -j -f "%Y%m%d" "$FILEEDIT" "+%Y-%m-%d"`    #BSD formatted
AIREDSEC=`date -j -f "%Y%m%d" "$FILEEDIT" "+%s"`    #BSD formatted

DIFF=$(((($AIREDSEC $DATESEC)/(60*60*24*7))+1))

for ((
i=0i<$DIFFi++))
do
    
ID=$(($ID+1))
done

NEWFILE
="$SERIES - "S${SEASON}""E${ID}".${EXT}"
# DO NOT TOUCH # to here

#NFO file creation
NFO="$SERIES - "S${SEASON}""E${ID}".nfo"
touch "$DIRPATH"/"$NFO"
echo "<episodedetails xsd="http://www.w3.org/2001/XMLSchema" xsi="http://www.w3.org/2001/XMLSchema-instance">
  
<title>Episode ${ID}</title>
  <
season>S${SEASON}</season>
  <
episode>E${ID}</episode>
  <
aired>${AIRED}</aired>
  <
plot />
  <
displayseason />
  <
displayepisode />
  <
thumb />
  <
watched>false</watched>
  <
credits />
  <
director />
  <
rating />
</
episodedetails>" > "$DIRPATH"/"$NFO"

mv "
$FILE" "$DIRPATH"
cd "
$DIRPATH"
mv "
$FILE" "$NEWFILE"

cd "
$DIRPATHOLD"
cd ..

#Removes old folder (recommended)
#rm -R 
$REMOVE
fi

# For testing purposes
#echo 
$FILE
#echo 
$EXT
#echo 
$FILEEDIT
#echo 
$NEWFILE
#echo 
$NFO

exit 0 
Reply
#30
something like this should work

Code:
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;'  http://IP:8080/jsonrpc

PS you might want to check the alterations I made in the previous post.
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply

Logout Mark Read Team Forum Stats Members Help
WWE Raw and Smackdown0