WWE Raw and Smackdown

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
BrEEdAA Offline
Junior Member
Posts: 25
Joined: Nov 2011
Reputation: 0
Post: #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
find quote
BrEEdAA Offline
Junior Member
Posts: 25
Joined: Nov 2011
Reputation: 0
Post: #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
find quote
BrEEdAA Offline
Junior Member
Posts: 25
Joined: Nov 2011
Reputation: 0
Post: #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"
find quote
lrusak Offline
Fan
Posts: 384
Joined: Sep 2011
Reputation: 3
Location: Canada
Post: #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

[Image: watched-clearlogo.jpg]
(This post was last modified: 2012-06-20 19:11 by lrusak.)
find quote
Deano316 Offline
Fan
Posts: 729
Joined: Jul 2011
Reputation: 8
Location: Brighton, England
Post: #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
(This post was last modified: 2012-06-20 19:02 by Deano316.)
find quote
lrusak Offline
Fan
Posts: 384
Joined: Sep 2011
Reputation: 3
Location: Canada
Post: #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

[Image: watched-clearlogo.jpg]
(This post was last modified: 2012-06-20 19:21 by lrusak.)
find quote
Deano316 Offline
Fan
Posts: 729
Joined: Jul 2011
Reputation: 8
Location: Brighton, England
Post: #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
find quote
BrEEdAA Offline
Junior Member
Posts: 25
Joined: Nov 2011
Reputation: 0
Post: #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
find quote
BrEEdAA Offline
Junior Member
Posts: 25
Joined: Nov 2011
Reputation: 0
Post: #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 
find quote
lrusak Offline
Fan
Posts: 384
Joined: Sep 2011
Reputation: 3
Location: Canada
Post: #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

[Image: watched-clearlogo.jpg]
find quote