Shepherd- how to set up as guide source for Australian TV

Discussion in 'Electronic Program Guide' started by etheesdad, June 5, 2009.

  1. etheesdad
    • Premium Supporter

    etheesdad Retired Team Member

    Joined:
    November 8, 2008
    Messages:
    831
    Likes Received:
    67
    Location:
    Adelaide
    Ratings:
    +68 / 0
    After I switched from Mythtv to MP, the only thing I missed was the excellent TV Guide, Shepherd. One of its more notable features (apart from verbose tv data) is its ability to scrape IMDB for Movies on TV, and thetvdb for episode data. The result is very good indeed.

    Features:
    I was browsing xpmediacentre.com.au and came across a discussion of how to get it working in Windows. I jumped at the chance to set it up, and thought it might be useful to provide the a guide here on how to do it for anyone interested. The information below is pulled from that thread and from some other sources.

    It requires a Linux box or a virtual machine with Linux running (in this case xubuntu). I used Virtualbox as the VM. Any VM would probably work though.

    On my machine the VM only uses 38mb of ram and 0% cpu when running minimised. (increases slightly when it grabs), but does not noticeably affect the performance of the machine.

    1. obtain xubuntu or another suitable distro

    2. install and configure virtual machine in XP/Vista/W7.

    (Steps for Virtualbox)

    new
    OS- Linux
    Type - Ubuntu
    memory - default (384mb)
    Virtual Hard Disk - NEW, dynamically expanding (8gb)

    3. boot xubuntu / virtual machine and add dependencies for shepherd


    Code (Text):
    1. sudo apt-get install xmltv libxml-simple-perl libjavascript-perl libalgorithm-diff-perl \
    2. libgetopt-mixed-perl libcompress-zlib-perl libdata-dumper-simple-perl \
    3. libdate-manip-perl liblist-compare-perl libdatetime-format-strptime-perl \
    4. libhtml-parser-perl libxml-dom-perl libgd-gd2-perl libdigest-sha1-perl \
    5. libarchive-zip-perl libio-string-perl libdbi-perl libclass-dbi-mysql-perl
    4. Install Guest Additions in the VM (Virtualbox) - this allows file sharing and a number of other useful features.

    In the VM window:

    Devices -Install -Install Guest Additions
    (toggle from full-screen mode so you can see the VM menu bar).

    Code (Text):
    1. cd /media/cdrom0
    2. sudo sh ./VBoxLinuxAdditions-x86.run
    restart

    5. Get Shepherd and configure (script is self explanatory)

    Code (Text):
    1. w-get http://www.whuffy.com/shepherd/shepherd
    2. perl ./shepherd
    (remove the '-' from w-get - its there because the forum blocks posts with this command)



    6. Run shepherd to get guide data

    Code (Text):
    1. perl ./shepherd
    (Takes awhile for the first run)

    The resulting file is stored at:

    ~/.shepherd/output.xmltv

    7. make and mount a shared folder

    In XP, make a folder and share it (ie, C:\shared)

    Virtualbox:
    devices
    shared folders
    machine folders
    add (path)
    tick "make permanent"

    then mount the shared XP folder to the Linux share

    Code (Text):
    1. sudo mount -t vboxsf (name of xp shared folder without path ie "shared") (name and path of linux shared folder ie "/home/usrname/shared)
    ie:
    Code (Text):
    1. sudo mount -t vboxsf shared /home/jim/shared
    8. direct MP to the file in the Host's (XP) shared folder

    TVserver config - XMLTV - Import c:\shared\tvguide.xml
    (dont forget to map channels in xmltv)
    - more info on the XMLTV plugin here

    9. Set up a cron job to make shepherd run automatically once per day

    Open a terminal window in xubuntu and enter:
    Code (Text):
    1.  
    2. export EDITOR=gedit
    3. export VISUAL=gedit
    4. crontab -e
    add 2 lines to the file:

    Code (Text):
    1.  
    2. # m h  dom mon dow   command
    3.  
    4. [B]0 12 * * * ~/.shepherd/shepherd --quiet 2>&1 >/dev/null
    5. 0 14 * * * cp /home/(username)/.shepherd/output.xmltv /home/(username)/shared/tvguide.xml 2>&1 >/dev/null[/B]
    6.  
    line 1 runs shepherd once per day at midday (12)
    line 2 copies and renames the output file to windows share folder at 2pm (14)

    --if you dont have gedit, substitute the name for the editor you use ie 'nano'

    10. Remove from taskbar

    Lastly, I found it a bit annoying having the VM on my taskbar as I dont really want to know its there, so I found a neat little utility that puts it in the system tray, where its out of the way.

    Powermenu

    The results are great. Much more detail than any tvguide.xml generator Ive run in the past.

    Thanks to Arkay and aanda6 for the information and support.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. CairnsFella

    CairnsFella Portal Pro

    Joined:
    July 24, 2008
    Messages:
    51
    Likes Received:
    1
    Ratings:
    +1 / 0
    Home Country:
    Look forward to giving this a try as since setting up MP, the EPG is the only thing giving me grief...

    Could you (or anyone else in the know) advise whether the EPG's grabbed by Shepherd tend to contain Series(Season) and Episode data. Although I appreciatte such data is not always available, of the solutions that I have tried so far, some I have not got to work, and others - although they work great - have not yet returned any series/episode info that I can use to get MP TV-Series working.

    Any help in this matter, greatly appreciatted.
     
  4. etheesdad
    • Premium Supporter

    etheesdad Retired Team Member

    Joined:
    November 8, 2008
    Messages:
    831
    Likes Received:
    67
    Location:
    Adelaide
    Ratings:
    +68 / 0
    I just had a look and cant see anything in the tv guide about season or episode data - just plot details for the episode. As far as whether it can be configured to do this, I dont know as Ive never tried. :)

    Its an interesting idea though and Id also be interested to know if its do-able.
     
  5. CairnsFella

    CairnsFella Portal Pro

    Joined:
    July 24, 2008
    Messages:
    51
    Likes Received:
    1
    Ratings:
    +1 / 0
    Home Country:
    Just a FYI.

    Whilst I have no doubt that had I pursued "Shepherd" as intended it would have been an exelent epg provider, I actually have managed to get the info I require through the oztivo data I already had. I do have to do a find/replace to tag extra info on to the episode/seried data already included (Im sure this wouldnt be a chore for those in the know, but I just do it in notepad).

    As a result I am able to pick up the required info in my recordings so that the programmes are automatically picked up by MP TVSeries without further intevention. On the few programmes I have recorded so far, this has been accurate, though I am led to understand that the oztivo data is not complete and sometimes innacurate.

    Still, for my needs, if I only occasionally have to perform a "rename" then thats better than doing it all the time.

    I'll keep my ear to the ground though, and if Shepherd does at any stage contain the data required I still look forward to giving it a try.

    Thanks
     
  6. S.O.P

    S.O.P Portal Pro

    Joined:
    January 13, 2007
    Messages:
    55
    Likes Received:
    1
    Ratings:
    +1 / 0
    Home Country:
    Hi etheesdad,

    I gave it a shot, started your guide, installed xubuntu-desktop 10.04 in VirtualBox with your settings and everything else default.

    Restarted xubuntu, logged in as my user, opened a terminal and entered your apt-get and failed on libjavascript-perl - couldn't find package.

    It's late here so I don't have time to troubleshoot it at the moment, do you have any ideas?

    Also, when I start my XP MP singleseat, how do I make Virtualbox and Xubuntu log in automatically and run Shepherd automatically when I get to that point?

    Keep in mind, while I've used Linux before, I'm not a power user and the guide, while well-written, isn't aimed at new users as it does leave some information out. Example: Boot Xubuntu/VirtualBox. Does that mean install Xubuntu in Virtualbox etc.

    Thanks in advance if your offering help to move me along or can you link to the threads where you collated all your info?
     
  7. MPBuddy

    MPBuddy New Member

    Joined:
    April 21, 2012
    Messages:
    1
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Australia Australia
    Thanks etheesdad, below is a variation to your method that I use for paytv program information.
    This method launches virtualbox/linux/shepherd once a day at 3am from the windows sheduler.
    1. Install virtualbox with linux mint 12 and shepherd as you described.
    2. Add a shared folder so that linux can write files directly to the windows xmltv folder.
      In virtualbox menu devices->shared folders add a share called xmltv and select the windows xmltv folder.
      Check "make permanent", but not automount. On win7 and MP1.2.3 the xmtv folder was "C:\program data\TeamMediaPortal\MediaPortal TV Server\xmltv"
    3. From the linux command line make the directory //media/share-xmltv then add the following command to "//etc/init.d/rc.local" so it mounts on boot.
      Code (Text):
      1. mount -t vboxsf xmltv //media/share-xmltv
      2.  
    4. Give the linux user shutdown privilages. Add the following to //etc/sudoers
      Code (Text):
      1. <username> ALL=NOPASSWD: /sbin/shutdown -h now
    5. In the linux users home folder add the following script called epg.sh
      Code (Text):
      1. perl shepherd
      2. echo copying epg to windows share
      3. cp ~/.shepherd/output.xmltv //media/share-xmltv/tvguide.xml
      4. echo Ctrl-C now to prevent shutdown.
      5. sleep 60
      6. echo shutting down now!
      7. sudo shutdown -h now
      8. sleep 10
    6. Create the scipt epg-startup.sh so that shepherd runs in a terminal
      Code (Text):
      1. xterm -e ./epg.sh
    7. Now you need to run this script on linux boot. In mint12 I did this using the "startup applications preferences" tool found in Applications->Other->Startup Applications. Add an item to run epg-startup.sh
    8. Now you need to launch virtualdub and linux from the windows command line. I created epg.bat on the windows desktop.
      Code (Text):
      1. echo EPG run on %date% at %time% > epg.log
      2. "c:\program files\oracle\virtualbox\vboxmanage.exe" startvm <virtualmachine name>
    9. In media portal configuration PowerScheduler++ add VirtualBox to the list of programs to prevent the computer from going to sleep while virtualbox is running.
    10. Run the epg.bat script from the windows task sheduler, say every morning at 3am. In win7 I found this only worked if used "Run only when the user is logged in". Maybe a permissions issue?
    11. In media portal configuration select to use xmltv. This plugin periodically checks to see if the tvguide.xml file has been updated.
    12. Map your channels to the epg data in the xmltv plugin.
    NB. The first time shepherd is run it can take a few hours.

    Good luck.
     
    Last edited: May 14, 2012
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!