What is WebEPG
WebEPG is another Electronic Program Guide grabbing application; however this one has been designed to be used with MediaPortal. There are a few other programs that do what WebEPG does but not as easily and not specifically designed to work with MediaPortal.
For general setup instructions, see the WebEPG setup guide.
For help on customizing WebEPG, see the following pages:
- Files and directories required by WebEPG
- WebEPG Grabber file structure
- WebEPG Template structure
- WebEPG Designer, an interface for designing grabber files
WebEPG Grabber File
To download EPG data from a website and import to your MediaPortal EPG database, you need a grabber file. You can edit an existing grabber or create a new grabber file.
The grabbers are stored in xml files located in the ProgramData\Team MediaPortal\MediaPortal TV Server\WebEPG\grabbers folder under the country code folder for your country.
If you create a new grabber file, use the domain URL of the channel provider (e.g. www_hbo_com.xml). See the section below on Channel ID:s for more detail.
Detailed information about the file structure of grabber files can be found on the WebEPG Grabber page.
Creating a new Grabber File
Here is an empty template you can use to get started:
You need to enter the following data (always leave in the quotation marks!):
- treatErrorAsWarning - true or false. If WebEPG runs into an error (for example if there's no programs on a channel for a day) it will continue grabbing the next day if this value is set to true. WebEPG will stop processing the current channel and continue with the next if this value is set to false.
- availableDays - The number of days data is available on the site.
- timezone - The name of the time zone for which the listings are provided.
- Channel id - The name of the channel configured in channels.xml. This is where WebEPG gets the channel name when mapping channels in the WebEPG TV Server plugin.
- siteId - The name of the channel on the site (unless there is only one channel program listings).
- Site url - The URL of the website containing program listings (this may contain optional parameters).
- start - A unique text string to search for the START of the program listings on the website's HTML code. Everything before this string will be ignored.
- end - A unique text string to search for the END of the program listings on the website's HTML code. Everything after this string will be ignored.
- tags - The first letter of each HTML tag to be used for matching in the Template section. Letters must be in upper case. Multiple tags are given in a string: "TSD".
- TemplateText - This is where you will enter the HTML tags and data fields that make up the program listing.
Entering the Template Text is usually the most difficult part. For this you need the HTML source for the page. This is normally done in every browser by right-clicking on the page and selecting View source. Then you need to locate the listings. Just search for the name of a program and the find the title, time, description, etc. Work out what is different between two programs and what is the same. You'll need to work out which HTML tags can be used to find the listings.
The best way to figure out the pattern of the website program listings is to use the WebEPG Designer program.
Check the WebEPG Grabber page for more details on the grabber file.
Check the WebEPG Template page for more details on entering Template text.
Once you have created your grabber file, open it into a web browser. This will check to see if the XML is correct and will also show any errors and the exact location of the errors in your grabber.xml file.
Once it passes the basic XML test, run WebEPG with one of your grabber channels mapped to a TV channel and see if any errors are reported. View the tv.log and error.log files in the Mediaportal log folder.
NOTE: If your grabber file has errors it will not appear in the list of channels or grabbers in the WebEPG Configuration!
Getting Data For More Than One Day
If you want to grab data for multiple days, and the data for subsequent days is on a different page, you need to figure out how to tell WebEPG to access those pages.
If the date is included in the URL, it is much easier. You can enter the variable Date data in the Site url section of the grabber file (e.g.
You can find more details on different ways of entering the date information on the WebEPG Grabber page.
If the date is NOT included in the URL, you may need to use the Post section of the grabber file. First you will need to find the Get/Post pattern. Look in the source data of the website for any method=post and find the name of the input. For example: post="schedule_date=[DD]/[MM]/[YYYY]" where schedule_date is the input id. See below for more details.
The GET/POST pattern
When the GET method is used, the page URL can be seen in the address bar of the web browser. However, when POST is used or the URL is not displayed, a good way to get this information is to install a local proxy.
For example install Paros (http://sourceforge.net/projects/paros) and then configure your browser to use the proxy at 127.0.0.1. This will allow you to see all the requests made to the web site when surfing around.
The channel IDs for WebEPG are stored in the channels.xml file.
Rules for creating new IDs:
- Use the domain URL of the channel provider.
- If the channel provider has an URL in multiple countries (and these channels are not different, ie same content), then use the one from the country of origin or the international one (these channels may already be in use by other grabbers, so always use an existing ID when possible).