XMLTV is an XML-based file format for describing TV listings.
mc2xml is a small and fast standalone command line program that downloads TV listings from Microsoft, TitanTV, or Schedules Direct, and outputs an XMLTV formatted file which you can then import into MediaPortal using the XmlTv plugin included with MediaPortal's TV Server.
MC2XML and XMLTV Plugin Setup
This guide assumes you have already completed the following steps:
- Setup your TV Server and scanned your TV channels.
There are 3 main setup steps:
- Download and setup mc2xml
- Enable XmlTv, set channel mappings, and initial tvguide.xml import
- Enable periodic updates to MediaPortal EPG
Create a folder to hold mc2xml and other files. You can use any folder. e.g:
- C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv
- Download mc2xml.exe from http://mc2xml.awardspace.info to your xmltv folder.
- Download xmltv.dtd from https://raw.githubusercontent.com/MediaPortal/MediaPortal-1/master/TvEngine3/TVLibrary/TVServer.Base/xmltv/xmltv.dtd to your xmltv folder.
Note on some recent changes.
As of July 26 2015 the "Microsoft legacy" service appears to have stopped providing listings updates for some countries. You may need to switch to a different guide data source.
One option would be to acquire the "donator version" of mc2xml which enables support for the "Microsoft" service.
Another option would be to subscribe to Schedules Direct. You would need to setup an account ($25/yr) at http://www.schedulesdirect.org/, configure your zipcode, and select the cable, satellite, or antenna option you want to use. When you run mc2xml select the Schedules Direct service, and enter your user name and password. To download 14 days of EPG data, use mc2xml.exe -d 336 for the command line (336 = 14 days x 24 hours).
- Click on mc2xml.exe to start the program. A few seconds later a “setup” window will pop-up.
- Select the service you wish to use, enter your zip code, country, user name and/or password as appropriate for the service you choose, and press "OK".
- A few seconds later a "lineup" window will pop-up listing available lineups or service providers. Select your lineup, e.g.
- For OTA (antenna) in US select "Digital Terrestrial Lineup", and press "ok".
- After a few seconds mc2xml downloads the EPG data and creates a xmltv.xml file in your xmltv folder. Rename this file tvguide.xml. Mc2xml also creates a mc2xml.dat file that holds setup information. Delete the mc2xml.dat file if you need to repeat the zipcode and lineup selection steps.
Note: you may also create a batch file to auto rename the xmltv.xml file to tvguide.xml for you.
mc2xml has a number of feature to select which channels you wish, rename them to match your channel names in MediaPortal, etc.
Setup XMLTV Plugin
- Start TV Server Configuration
- Select Plugins *and enable *XmlTv.
- Select *XmlTv > General *set your xmltv folder in the tvguide.xml folder field. e.g the folder you selected in MC2XML download above:
- C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv
- XmlTv uses the tvguide.xml and the xmltv.dtd files in this folder.
- Click Import. This should cause the XmlTv plugin to import the channels from your guide data. Programs are not imported until you map/link the guide channels to TV Server channels. Mapping is explained in the next section.
- Select XmlTv > Mappings,
- set "All Channels" in group, set the "Partial match" checkbox, and press "Load/Refresh" to load channel mapping info into xmltv.
- If you also want to Load radio channels data then check that option (if your source provides radio guide data)
- After a few seconds XmlTv > Mappings will show initial mappings and has a dropdown list to select a GuideChannel *for each *TuningChannel.
- There are 5 columns in this screen. The important columns are:
- TuningChannel: MediaPortal TV Channel from the "All Channels" group
- GuideChannel: “TV Guide” Channel that is mapped to the TuningChannel
- Status field shows "match status"
- Green = Exact Match, TuningChannel matches GuideChannel
- Yellow = Partial match, double-check the GuideChannel to verify it has the correct information
- Red = No match, you need to set correct GuideChannel using the dropdown list.
- VisibleInGuide: This column is checked if the TuningChannel is visible in the MediaPortal TV Guide.
Note: For the US and Canada, you can use the www.zap2it.com TV listings page to get a listing of TV stations and ATSC Channel.SubChannel numbers for your zipcode. Use "Change My Location" to set your “Zipcode” and "Local Broadcast (Antenna)" to get your local TV listings.
If needed you can find the ATSC Channel.SubChannel for the MediaPortal TuningChannel by selecting TV Channels > All Channels, right-click on the channel and select Edit. For KQED+ the Detail field has the following information.
- Detail = 30 9:2
- 30 = RF Channel shown in MediaPortal Channel number column
- 9:2 = ATSC Virtual Channel.SubChannel = 9.2, this is the channel you see on a TV set and zap2it TV listings.
- In this example, TuningChannels "KQED-HD" and "KQED+" are both mapped to same GuideChannel = KQEDDT and "WORLD" did not match any GuideChannel. (these are channels 9.1, 9.2, and 9.3)
- Use the dropdown list for each GuideChannel to set the correct channel. In this case I used the zap2it.com lisitngs to find the correct GuideChannels for KQED+ = KQEDDT2 and WORLD = KQEDDT3.
- Repeat this for all channels that are visible in your MediaPortal TV Guide. When all channels are mapped, press "Save" and then "Load/Refresh". All of the "mapped" channels should show "White" status.
Import the TV Guide Data
To import the TV Guide data:
- Select XmlTv > General
- Select the "Import new tvguide.xml" check box
- Select Delete old programs before import check box,
- Clear the other check boxes
- Press Import
It will take some time for xmltv to import all of the TV Guide information and the import status report will update when xmltv is done. In this example it takes about 5 minutes to import 104 channels and 25,424 programs. See 1st picture for an example of XmlTv > General.
To verify the TV Guide data, exit TV Server Configuration and start MediaPortal. Select the TV Guide and verify your channels have the correct TV guide information (e.g. using the zap2it TV guide in US/Canada) or another TV guide. It may take a couple tries to get the correct channel mapping setup, but you only need to do it once.
If you need to make corrections, exit MediaPortal and restart TV Server Configuration. *Select *XmlTv > Mappings, set "All Channels" in group and press Load/Refresh to reload your channel mappings, and correct any problems.
When the XMLTV setup is done you should restart the TV Server with the setup changes. Start *TV Server Configuration, *select *Manual Control, *press "stop service", then "start service".
Schedule EPG Updates
You need to run mc2xml periodically to keep the MediaPortal EPG up to date by downloading new data and updating the tvgude.xml file. The XmlTv plugin periodically checks the tvguide.xml file and imports new EPG data when the file is updated. Here are 2 ways you can enable updates.
- Windows scheduled task
- MediaPortal PowerScheduler plugin
Windows Scheduled Task
Search the web for "create windows scheduled task" to find information on setting up a scheduled task for your version of Windows. The details vary a little with different versions of Windows. You need to set the following information when creating the task (modify the drive letter and folder location to match your xmltv folder location):
- Select “Daily” and the time you want to run mc2xml
- Run: browse to your xmltv folder and select mc2xml.exe
- Arguments: -o tvguide.xml
- Start In: C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv
- If your TV server sleeps when Idle, you need to use “properties -> Conditions” to set the “Wake the computer to run this task” checkbox to wakeup your TV Server to run the task.
Note: XP does not have the "Arguments" field. After selecting the folder for mc2xml.exe, add -o tvguide.xml to the end of the run command. For example:
- "C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv\mc2xml.exe" -o tvguide.xml
For Vista you can test your Windows task using "Action -> run”. The task history shows the results from running the task. The next day the task history and your xmltv folder should show a new date for the tvguide.xml and mc2xml.dat files when the task has run and the MediaPortal TV Guide should show new information. XP has similar options to test your scheduled task.
PowerScheduler Plugin Settings
Start the TV Server Configuration program, select Plugins and enable PowerScheduler. See the PowerScheduler wiki for more information about this plugin.
Use notepad to create a 3 line batch file with the following information in your xmltv folder to run mc2xml:
Modify the drive *letter and *cd path for your xmltv folder, e.g. mc2xml.bat, make sure the file extension is “.bat”.
Select PowerScheduler > EPG and set the following checkboxes and fields:
- Prevent standby when grabbing EPG
- Wakeup system for EPG grabbing, select a time, and set the days you want for EPG grabbing.
- Set the path to your batch file in the “Run command before internal handlers are triggered” field. e.g.:
- C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv\mc2xml.bat
When the *PowerScheduler *setup is done you should restart the TV Server with the setup changes.
The PowerScheduler++ plugin can also be used for periodic EPG updates. See the PowerScheduler++ Wiki for more information on downloading, installing, and using this plugin.
Additional resources for XmlTv:
- MediaPortal XmlTv Wiki. This describes the XmlTv settings in detail.
- MediaPortal XmlTv Forum. You can ask questions and read forum postings.
- MediaPortal Log Files Wiki. Add log files to your forum messages to help with problem debug.
This page has no comments.