Setting up EPG data

From HTPCnz

Jump to: navigation, search

Contents

Setting Up EPG Data

Sources of data

To make an HTPC really useful, and to seperate it from a DVD recorder or other PVR, it needs accurate guide data. In New Zealand there are 3 main sources of guide data, with different ways of obtaining the different sources avaliable (depending on operating system). The avaliable sources are:

  • Satellite EIT Tables
  • Website scraping
  • Broadcaster hosted XML files

Methods of obtaining data

Directly use satellite EIT tables

General

Obviously this requires a satellite dish and satellite card. For any satellite channels in your setup, it is simply a case of telling the program to use the EIT data. For channels recieved via analogue (including S-Video from a Sky box) or DVB-T it is generally necessary to download the data into an XML format before loading it into the PVR software. However MediaPortal 1.0 has the ability to do EPG only mapping, which means Sky's unencyrpted EPG stream can be used for any channel from any source. The guide for doing this is below<ref>Template:Cite web</ref>:

1. Make sure all your analog channels are set up and working correctly, either via your capture card's tuner or S-Video input and IR blaster, if you're using a set-top-box.
2. Scan in the Sky channels.

  • You can either create you own custom Transponder .ini files in `c:\Program Files\Team MediaPortal\MediaPortal TV Server\Tuningparameters` Or use the Optus D1/B1 preset that comes with TV Server; this should contain all the Sky transponders as well as the Freeview ones.
  • All the Sky channels will scan in as encrypted channel and have a red icon
  • From the "Tv Channels" node delete all these encrypted channels except the ones for which you have matching analog channels.

3. Combine the analog channels with the DVB-S encrypted channels.

  • We'll use the "Prime" channel for this example
  • Select the "Combinations" node under "TV Channels"
  • Select your analog card. In the left listview you'll now see all your analog channels
  • From the left listview select "Prime" and in the right listview you'll see channels from other cards
  • In the right list select the matching "Prime" encrypted channel; it should be at the top of the list
  • Click the "Combine" button!
  • What we now have is 1 channel with 2 sets of "Tuning Details"; that is, "Prime" can now be viewed from either the analog card or the DVB-S card.

4. Enable EPG grabbing on the DVB-S channels
Continuing on our example with the "Prime" channel:

  • Select the the "TV EPG grabber" node from under the "TV Channels" node
  • In the listview on the left tick the check box for "Prime" (and the other DVB-S channels)
  • "Prime" is now usable from Analog and DVB-S and it has an EPG source. One problem remains; "Prime" can't actually be viewed via the DVB-S card (because it is encrypted!); this will cause a problem if we try to schedule a recording on "Prime" and some other analog channel at the same time; a conflict won't be detected because TV Server believes that it can use the DVB-S card to record prime as well as the analog card.

5. Change the mapping for the encrypted DVB-S channels to "EPG Only" mappings:

  • Again with our "Prime" example.
  • Select the "TV Mapping" node under the "TV Channels" node
  • Select your DVB-S card. In the left listview will be channels that are not mapped to the DVB-S card and in the right channels that are.
  • In the right listview double click "Prime"; you will see that it changes to "(EPG Only)"
  • What have done is told TV Server that "Yes we can tune "Prime" on the DVB-S card but only for EPG Grabbing". The card won't be used when trying to view or record on "Prime".


This will need to be done for all your channels, but once it is setup nothing else is required. The guide will constantly update itself and no internet connection is required.

Downloading data off satellite using epgsnoop under Linux

Using epgsnoop under Linux (or cygwin) it should be possible to download the satellite EIT data into an xml format, if a HTPC without an internet connection needs guide data for analouge/DVB-T. A guide for this will be added later.

Download from pvr geek's host of EIT data

At pvr geek there is a host of XML formatted files from various sources (currently Sky and Freeview EIT tables, and the officially hosted files). The data from the two EIT feeds as been run through a post proccesor to clean up inconsistent/messy file names (list of current title replacements here), and the Sky feed of TV1 has been modified to include the more detailed BBC World information from the BBC World channel on Sky (rather than just showing "BBC World" when it is on in the morning). The Sky and Freeview feeds have been combined into an -all file and this is the file that will be used for this guide. The procedure is different for Windows and Linux.

Windows

To obtain the data, we are going to create a batch file that downloads the file, uncompresses it, cleans up and renames the file to a standard tvguide.xml. Firstly, create a folder on your computer, download wget and gzip for Windows and extract the excutables into this folder. Also, download the official xmltv.dtd file into this folder. Now open up Notepad and copy the following into it:

del *.gz
wget http://epg.pvr.geek.nz/epg/listings-all.xml.gz
gzip -d listings-all.xml.gz
ren *.xml tvguide.xml

Change the 'Save as type' to 'All Files', and save the file in the same folder as before as something like Guide.bat. Running this file will now give you a tvguide.xml file to load into your PVR program (see below).

Linux

Under Linux (assuming you are using MythTV) it is much simplier. An xmlTV-complaint grabber has been written, all that is required is to download the script and setup the grabber in MythTV. To do this, at the command prompt copy in (without the $'s):

$ wget http://nice.net.nz/scripts/tv_grab_nz-py # Download the file
$ sudo mv tv_grab_nz-py /usr/local/bin/ # Put it in a system directory
$ sudo chmod 755 /usr/local/bin/tv_grab_nz-py # Make it executable

Now open up mythtv-backend setup and go to 3.Video Sources and create a new source. Scroll through the lisitngs grabbers and select tv_grab_nz-py. Go to finish, and Alt-Tab to the terminal that has come up to configure the grabber.

Download pvr geek's hosted files using Mentalinc's downloader

This is a piece of software put together by Geekzone member mentalinc for nicely downloading the hosted XML files. It can be found here and is a Window's only solution. Instructions for setup for different PVR sofware is avaliable on his website:


How to configure for GB-PVR
http://mentalindustries.orconhosting.net.nz/epgFiles/GB-PVR.html

How to configure for dvbviewer:

http://mentalindustries.orconhosting.net.nz/epgFiles/dvbviewer.html

How to configure for Mediaportal

http://mentalindustries.orconhosting.net.nz/epgFiles/mediaportal.html

How to configure for Mediaportal TV Server

http://mentalindustries.orconhosting.net.nz/epgFiles/mediaportalTVServer.html

Use Reven's xmlTVNZ screen scraper

A local guy has create a small program for 'scraping', it is at reven.co.nz. Guides for setting it up to download the data can be found here.

Download xml files from TVNZ and Mediaworks

Both Mediaworks and TVNZ are currently hosting XML files which could be downloaded and used directly.  However this would require a bit of work, and it uncessary given the other methods avaliable. The links are listed here in case:

http://listings.tvnz.co.nz/freeview/tvone_7days.xml

http://freeviewnz.tv/epg_data.php

How to incorporate data into PVR software

Mediaportal

1) Open TV Server configuration, go to plugins and click 'xmlTV' then go the 'xmlTV' under plugins

2) Point MP to the folder where your tvguide.xml file is and click 'Refresh' down the bottom until it finds channels

3) Go to the 'Mappings' tab and check all the mappings are correct.

4) Click 'Save' in the top right hand corner and save and exit TV Server config.

That's it, you just need to regularily update the tvguide.xml file and MP will auto-update the guide.

GB-PVR

Enter http://epg.pvr.geek.nz/epg/listings-freeview.xml.gz in place of the XML file and GB-PVR will automatically download the Freeview listings from the site for you using the scheduled time in the GB-PVR config settings.

MythTV

The steps for setting up a guide in Mythtv using using the tv_grab_py script have been described earlier. It is possible and somewhat more complicated to use reven's data, 

1. Install the mono framework
Download from badgerports:
This involves adding badgerports to your repository and updating, instructions are at the above link
2. Install xmlTVNZ
Download from xmlTVNZ Homepage and place in a new directory called 'reven' under home (i.e. '$mkdir reven' from home directory)
Unzip (from reven folder) using:

tar  -xvf *.gz
Run the xmlTVNZ Command Builder to build the command line you need to grab the channels you want
3. Create a file to grab the data
Create a new file called tv_grabber.sh in the reven folder
Copy the output generated by the xmlTVNZ Command Builder with the prefix "mono" and fix the paths
Example tv_grabber.sh file:
#!/bin/bash
mono /home/userid/reven/xmlTVNZ.exe /home/userid/reven/tvguide.xml -days 8 default_tv1 default_tv2 default_tv3 default_c4 default_prime
mythfilldatabase --file 1  /home/userid/reven//tvguide.xml
4. Set myth to execute this command as tv guide graber "sh /home/userid/reven/tv_grabber.sh"

Vista Media Center

Reven's guide provides the required steps, even if a different source of data is used.

Windows XP Media Center Edition

Reven's guide provides the required steps, even if a different source of data is used.

Setting up guide auto update

Windows 

No matter what source of data is being used, it is necessary to update the guide data regularly.

Vista

  1. Open up Task Scheduler (type Task Scheduler into the search bar)
  2. Go to Task Scheduler library, click 'New Basic Task', call it something like Guide
  3. Set trigger to Daily, and change to every 3 days making sure the set time is when the computer is on
  4. Under Action select 'Start a program', then point the Program/script towards the batch file that downloads the data.
  5. Click Next, then Finish

XP

  1. Open up Task Scheduler (click Start, click All Programs, point to Accessories, point to System Tools)
  2. Click 'Add Scheduled Task', then browse for the script that updates your guide, click Next
  3. Tick the 'Open advanced properties for this task when I click Finish' box, then click Finish
  4. Under the schedule tab, set it to run every 2-3 days, click Finish

Linux

The best way to set up the auto guide update is from within mythtfrontend, although how you do this depends on how your guide is configured.

  1. Open up mythfrontend, go to Utilities/Setup, scroll down to Setup
  2. Go to General settings and click through to the mythfilldatabase page
  3. Select 'Run mythfilldatabase automatically', and set the frequency to every 3 days
  4. Click through to Finish


However if using a manual script to run mythfilldatabase (combined with reven's grabber) it is necessary to change the script run to your custom script.


<ref>MediaPortal Wiki</ref>

{{#widget:Addthis page_name=Setting up EPG data page_url=http://www.htpcnz.net/Setting_up_EPG_data account_id=my-account-id logo_url= logo_background=FFFFFF logo_color=FFFFFF brand=HTPCnz options=favorites, email, digg, delicious, myspace, facebook, twitter, furl, googlebookmarks, reddit, live, more offset_top=0 offset_left=0

}}

{{#widget:jskit_ratings |title=Setting up EPG data |permalink=http://www.htpcnz.net/Setting_up_EPG_data |path=Setting up EPG data |view=combo }}



Personal tools