WWE Raw and Smackdown
#31
(2012-06-21, 19:46)lrusak Wrote: 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.

Remove original folder failed for me, not too fussed about that tbh mate. Will try out the update library code thanks
Big Grin
Reply
#32
Here is the latest update to the script. credit still goes out to lrusak for the original. Some improvements have been made to the nfo file creation, and xbmc library (including auto update upon completion)

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 [ -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 - "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>
  <title>$SERIES</title>
  <showtitle>$SERIES</showtitle>
  <rating>9.900000</rating>
<epbookmark>0.000000</epbookmark>
<year>2012</year>
<top250>0</top250>
  <season>${SEASON}</season>
  <episode>${ID}</episode>
<displayseason>-1</displayseason>
<displayepisode>-1</displayepisode>
  <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

curl --get "http://xbmc:xbmc@localhost:8083/xbmcCmds/xbmcHttp?command=ExecBuiltin&parameter=XBMC.updatelibrary(video)"
exit 0

Reply
#33
did the JSON-RCP method not work for you?
"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
#34
This script is exactly what I have been looking for but my problem is I am a total NOOB so I apologize. Huh

I have a Windows Vista pc, and I have SABnzbd rss feeds setup properly. I know this script goes in the SABnzbd folder but what extension do I name it with? I tried .exe and it fails.

Also, I would like to send the file to a mapped network drive and I noticed that absolute path is necessary. Can I request it be sent to a H:/Videos directory?

Thanks for the help, I have been working on getting this going for quite a while and was happy to stumble upon this script.
Reply
#35
Won't work on windows. For linux only. Sorry.
"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