[LINUX] Add VDR recordings to library (python script)
#1
Rainbow 
Here is a little script that generates the necessary files:

Code:
#!/bin/bash

VDRREC="/mnt/nas/videos/vdr"
TVFILE="../tvshow.nfo"

for i in $(find $VDRREC -name info.vdr)
do
  VDRDIR=$(dirname $i)
  VDRFILE=$(basename $i)
  cd $VDRDIR

  if [ -f info.vdr ];then
     TITLE=$(grep "^T " info.vdr | sed "s/^T //")
     INHALT=$(grep "^D " info.vdr | sed "s/^D //")
     EPISODE=$(grep "^S " info.vdr | sed "s/^S //")
     if [ -z "$EPISODE" ];then
          EPISODE="$TITLE"
     fi
  fi

  echo "<tvshow>"                  > $TVFILE
  echo "<title>$TITLE</title>"    >> $TVFILE
  echo "<plot> </plot>"           >> $TVFILE
  echo "</tvshow>"                >> $TVFILE

  echo "<episodedetails>"          > 001.nfo
  echo "<title>$EPISODE</title>"  >> 001.nfo
  echo "<rating></rating>"        >> 001.nfo
  echo "<season></season>"        >> 001.nfo
  echo "<episode></episode>"      >> 001.nfo
  echo "<plot>$INHALT</plot>"     >> 001.nfo
  echo "<credits></credits>"      >> 001.nfo
  echo "<director></director>"    >> 001.nfo
  echo "<aired></aired>"          >> 001.nfo
  echo "<actor></actor>"          >> 001.nfo
  echo "</episodedetails>"        >> 001.nfo
done

its quick and dirty, but works - maybe you want to put more features in ...
Reply
#2
Maybe should post about that here:
http://forum.xbmc.org/showthread.php?tid=36988
and here:
http://forum.xbmc.org/showthread.php?tid=45314
...and perhaps here too(?):
http://www.xbmc.org/trac/ticket/5595
...might also be related to this(?):
http://forum.xbmc.org/showthread.php?tid=34485

Wink
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] Add VDR recordings to library (python script)1