mc2xml
bookmark: http://mc2xml.mooo.com
mc2xml is a small and fast command line program for Windows, Linux and macOS that can download your TV listings and convert them to an XMLTV formatted (xmltv.dtd) .xml file.

mc2xml options (case sensitive):

-aappend " *" to new programs
-Aappend " *" to live programs
-bappend " *" to not new programs
-Foutput channel "name" first (rather than "number name")
-Linclude <live /> tag (not part of xmltv.dtd)
-uoutput date/time in UTC (default = localtime)
-Uoutput UTF-8 (default = "ISO-8859-1")
-fforce re-download on media center service (use responsibly)
-d <#> set listings duration (in hours)
-s <[+/-]#> set listings relative start position (in hours)
-c <code> set country code
-g <code> set postal/zip code
-w <seconds> wait for <seconds> and exit
-r <key>:<secret> use tivo service (requires consumer key & secret)
-t <id> use titantv service (requires 30 character id)
-V <apiKey> use tvmedia xmltv service (requires api key)
-M <apiKey> use metabroadcast service (requires api key)
-P <user>:<pass> use perc data service
-T <user>:<pass> use schedules direct service
-J <user>:<pass> use schedules direct json service
-1use zap2it
-2use tvguide.com
-3use tvguide.co.uk
-i <#> increment all channel numbers by <#>
-I <xmltv file> include <xmltv file> in output
-R <filename> set ren filename (default = "mc2xml.ren")
-D <filename> set dat filename (default = "mc2xml.dat")
-C <filename> set channel file (default = "mc2xml.chl")
-o <filename> set output file (default = "xmltv.xml")

mc2xml quickstart: (see also: FAQ)

  • Windows:

    1. Run "mc2xml", it has a simple graphical user interface.
    2. Select a service and input postal and country code and press OK
    3. Select lineup number from the returned list and an xmltv.xml file will be produced.
    4. Note: The lineup will be stored in the "mc2xml.dat" file in the same folder that mc2xml was run from (the cwd = current working directory) which must have write permission.
      The "Program Files" folder on Windows 10 usually does not have write permission.
      The -D parameter can be used to specify a full path and filename.
      If you need to reselect a lineup, delete the mc2xml.dat file.

  • Other OSs and command line usage:

    1. Run mc2xml with -c and -g parameters to set country & postal/zip code

      • -r is optional, and requires a consumer key & secret (-c & -g are required)
      • -t is optional, and requires a 30 character titantv uuid (-g is required)
      • -V is optional, and requires a tvmedia API key (-c & -g are not needed)
      • -M is optional, and requires a metabroadcast API key (-c & -g are not needed)
      • -P is optional, and requires an PD account user:pass (-c & -g are not needed)
      • -T is optional, and requires an SD account user:pass (-c & -g are not needed)
      • -J is optional, and requires an SD account user:pass (-c & -g are required)
      • -U is required for languages that contain non ISO-8859-1 characters

    2. Select lineup number from the returned list and an xmltv.xml file will be produced


 
Downloads (v1.7.1)

MS Media Center Services
After many years of service Microsoft has discontinued the Windows Media Center Electronic Program Guide.

There are other services that offer TV listings.

Windows (x86)
mc2xml.exe
Linux (x86)
mc2xml
macOS (x86-64)
mc2xml
downloads require javascript


  • mc2xml is for personal use only
  • not for redistribution or integration within other packages or within other software or on other hosts
  • some anti-virus programs (norton or windows defender) may view compressed executables as potential threats or trigger a false positive warning: mc2xml is compressed for size

DonationWare: If this software is useful to you please donate!
This software is not crippled, but it is not freeware either. If you determine that it is useful to you please donate an appropriate amount. If it isn't useful, then you probably won't be using it! :)

Service information

  1. Microsoft media center legacy service: Discontinued by Microsoft.

  2. Metabroadcast ATLAS service: is a free service for UK TV listings. More info is here.

  3. TiVo Metadata service is a media API platform (with 30 day trial) for TV listings in many countries, more info is here.

  4. Perc Data service: is a subscription based service (with 7 day trial) for TV listings in North America from Nielsen/Gracenote. It uses the same data source as Schedules Direct. More info is here.

  5. Schedules Direct service: is a subscription based service (with 7 day trial) for TV listings in North America (and additional regions) from Nielsen/Gracenote. More info is here.

  6. Schedules Direct JSON service: is a subscription based service (with 7 day trial) for TV listings in many countries from Nielsen/Gracenote. This service has season/episode information and some other data not available in their standard service. An SD account works on both SD services. See here for more information.

  7. TitanTV service: offers TV listings for the US market only. The listings are good and the ATSC service seems complete, but the program details are not as robust as the media center service. More info is here.

  8. TVMedia XMLTV service: is a subscription based service (with 14 day trial) for TV listings for North America only. More info is here.

  9. Microsoft media center Win7+ service: Discontinued by Microsoft.

  10. Xbox OneGuide service: is a TV listings service for many countries. This MS service uses the same TiVo supplied guide data as the MS Media Center service but it targets real time interaction rather than bulk schedule downloads (the Media Center service has smaller pre-packaged daily downloads). I'm not sure if it will add much value over the Media Center Win7+ service for most users. More info on service differences are here. (Not enabled in downloadable version)

  11. Zap2it: Online TV listings from Nielsen/Gracenote. More info here.

  12. TVGuide.com: Online TV listings from TiVo. More info here.

  13. TVGuide.co.uk: Online TV listings from Metabroadcast. More info here.

General information

  • mc2xml will save your lineup selection (and user/password and API key if required by the chosen service) to "mc2xml.dat" in the current working directory. (It does not save -o or other input/output optional parameters other than -U, -u, -F, -A, -a). If you want to re-select your lineup, delete mc2xml.dat.

  • Run "mc2xml" from the directory where "mc2xml.dat" is located whenever you want to output a new xml file. No command line parameters are required once the "mc2xml.dat" file has been created if you use the default input/output filenames (mc2xml.chl, xmltv.xml, etc). Make sure this directory has write permission. If running mc2xml from a .bat file make sure to "CD" to the correct folder first.

  • If you want to limit which channels are output in your xml file you can create a "mc2xml.chl" text file (in the same directory as mc2xml.dat). The channel inclusion and exclusion lists are initially empty so all channels will be included. Specifying channel numbers, channel number ranges, channel names, or channel ids on separate lines will create an inclusion list (perl style regular expressions are supported for names/ids). If the first character of a line is a "-" it will be added to the exclusion list (which is the first list consulted in the case of overlap). If you only want to select channels to exclude, only use lines that start with "-" and leave the inclusion list empty.

     mc2xml.chl 
    # include channel 5
    5
    # include channels 9 to 15 (inclusive)
    9-15
    # exclude channel 10
    -10
    # include channels 17 to 21.2 (inclusive)
    17-21.2
    # include channels named HBO
    HBO
    # exclude these channel names, escape first character of name if a digit
    -[3]DTV
    -LOOR
    # exclude these channel names, match regular expression
    -PPV(\d+)
    # include the channel that matches this channel id
    I20.515292.microsoft.com
    # include channels that match the channel id regular expression
    I51.*xboxlive.com
    I.*ec3dc96d-83da-c806-0ad0-7b566372a57a.xboxlive.com

  • If you want to rename some channel numbers or names you can create a "mc2xml.ren" text file (in the same directory as mc2xml.dat) listing the colon separated from:to channel numbers or names on separate lines:

    (the "from" can also be a channel id, to distinguish duplicate channel numbers or names)

     mc2xml.ren 
    605:2
    BBC1:BBC News
    I20.515292.microsoft.com:55

F.A.Q.
sd
  • How do I use the Schedules Direct service?

    • Sign up for an account and select your lineups and channels on the website
    • Use the -T user:pass mc2xml command line parameter (user:pass is saved in mc2xml.dat, pass can not contain a colon). On Windows the user & pass can be input in the graphical interface.
    • Default is 7 day download (you can change this with the -d <hours> command line parameter).


sd
  • How do I use the Schedules Direct JSON service?

    • Sign up for an account
    • To minimize the amount of data needed to be downloaded you can use an mc2xml.chl text file to limit the number of channels in your lineup, or limit the number of hours of schedule data (using the -d <hours> parameter). All available data for all channels in a lineup is downloaded by default. Data is not cached, so this isn't quick if you are requesting a lot of data and the server is heavily loaded.
    • Downloading multiple lineups would require the use of multiple .dat files (note: SD allows 4 lineups stored per account at once, and 6 lineup changes (add or delete) per day, but mc2xml only downloads the one stored in the current mc2xml.dat file)
    • If you wish to delete all but the current lineup from your account you can use the --delete-lineups parameter. Any lineup deletions will count towards your 6 lineup change per day limit.
    • This service sends data in chunks and mc2xml uses 4 parallel threads if there is a large amount of data (depending on the number of channels/programs/days of schedule you have requested). You can limit this with the --max-threads=# parameter if needed.
    • Episode images are within the program data and will be output as program icon urls. If you want more program icon urls (movies/shows/sports), use the --sdjs-images optional parameter; this will request more server data and take more time
    • If you want to use a user-agent string you can set the USERAGENT environment variable (set USERAGENT=email or any string) before running mc2xml (requires latest version)
    • The country and postal/zip code formats supported by the Schedules Direct JSON service are in the following table of examples: The -J parameter sets your user and password (passwords can not contain a colon), -U outputs UTF8 characters instead of ascii. On Windows the graphical interface has input boxes for these options, but you must follow the expected postal/zip code format.


    • US: mc2xml -J user:pass -U -c us -g 12345
    • CA: mc2xml -J user:pass -U -c ca -g H0H0H0
    • GB: mc2xml -J user:pass -U -c gb -g CF31

    • AI: mc2xml -J user:pass -U -c ai -g AI-2640
    • AG: mc2xml -J user:pass -U -c ag -g AG
    • AR: mc2xml -J user:pass -U -c ar -g A4190
    • AT: mc2xml -J user:pass -U -c at -g 6886
    • AW: mc2xml -J user:pass -U -c at -g AW
    • BB: mc2xml -J user:pass -U -c bb -g BB14001
    • BM: mc2xml -J user:pass -U -c bm -g CR01
    • BQ: mc2xml -J user:pass -U -c bq -g BQ
    • BR: mc2xml -J user:pass -U -c br -g 01419
    • BS: mc2xml -J user:pass -U -c bs -g BS
    • BZ: mc2xml -J user:pass -U -c bz -g BZ
    • CH: mc2xml -J user:pass -U -c ch -g 3303
    • CL: mc2xml -J user:pass -U -c cl -g 1000000
    • CO: mc2xml -J user:pass -U -c co -g CO
    • CR: mc2xml -J user:pass -U -c cr -g 10101
    • CW: mc2xml -J user:pass -U -c cw -g CW
    • DE: mc2xml -J user:pass -U -c de -g 14050
    • DK: mc2xml -J user:pass -U -c dk -g 9260
    • DM: mc2xml -J user:pass -U -c dm -g DM
    • DO: mc2xml -J user:pass -U -c do -g 10101
    • EC: mc2xml -J user:pass -U -c ec -g 170950
    • ES: mc2xml -J user:pass -U -c es -g 28001
    • FI: mc2xml -J user:pass -U -c fi -g 91980
    • FR: mc2xml -J user:pass -U -c fr -g 38800
    • GD: mc2xml -J user:pass -U -c gd -g GW
    • GT: mc2xml -J user:pass -U -c gt -g 01001
    • GY: mc2xml -J user:pass -U -c gy -g GY
    • HN: mc2xml -J user:pass -U -c hn -g HN
    • IT: mc2xml -J user:pass -U -c it -g 00100
    • JM: mc2xml -J user:pass -U -c jm -g JMAAW01
    • KN: mc2xml -J user:pass -U -c kn -g KN
    • KY: mc2xml -J user:pass -U -c ky -g KY1-0001
    • LC: mc2xml -J user:pass -U -c lc -g LC
    • MX: mc2xml -J user:pass -U -c mx -g 11500
    • NO: mc2xml -J user:pass -U -c no -g 0001
    • PA: mc2xml -J user:pass -U -c pa -g PA
    • PE: mc2xml -J user:pass -U -c pe -g 23006
    • PR: mc2xml -J user:pass -U -c pr -g 0061
    • SE: mc2xml -J user:pass -U -c se -g 10005
    • SX: mc2xml -J user:pass -U -c sx -g 97150
    • TC: mc2xml -J user:pass -U -c tc -g TKCA1ZZ
    • TT: mc2xml -J user:pass -U -c tt -g TT
    • UY: mc2xml -J user:pass -U -c uy -g 11000
    • VC: mc2xml -J user:pass -U -c vc -g VC0100
    • VE: mc2xml -J user:pass -U -c ve -g 1010
    • VG: mc2xml -J user:pass -U -c vg -g VG1110


pd
  • How do I use the Perc Data service?

    • Sign up for an account and select your lineups and channels on the website
    • Use the -P user:pass mc2xml command line parameter (user:pass is saved in mc2xml.dat, pass can not contain a colon). On Windows the user & pass can be input in the graphical interface.
    • Default is 7 day download (you can change this with the -d <hours> command line parameter).


tvmedia
  • How do I use the TVMedia XMLTV service?

    • TVMedia is a source for North American TV listings which can be viewed online at TVTV.ca / TVTV.us
    • Sign up on their xml service and select your lineups, and get an API Key. Input that key into mc2xml with the -V <apiKey> parameter and all selected lineups will be downloaded and output into an xmltv.xml file. On Windows this can be done through the graphical interface.
    • All selected lineups are output in a single xmltv.xml file
    • If you have conflicting channel numbers over multiple lineups you can use the mc2xml.ren channel rename feature.


TITANTV
  • How do I use the TitanTV service?

    • TitanTV is a source for US TV listings
    • Add -t <id> -g <zipcode> to the command line when initially selecting your lineup. Service selection, id and zipcode are saved in mc2xml.dat On Windows this can be input in the graphical interface.
    • The xml service requires your 30 character UUID (not the same as a username on their web service). If your ID has expired you will receive a "-t" error and will need to delete the mc2xml.dat file and specify another (or find one on ye olde interweb).
    • This service doesn't seem to compress its listings so the downloads can be large
    • By default a week of listings are downloaded, but this is configurable with the -d <hours> parameter


metabroadcast
  • How do I use the Metabroadcast ATLAS service?

    • Metabroadcast ATLAS is a source for UK TV listings
    • Sign up on their ATLAS service and get your free API Key. On the website (Atlas Administration) create an application and enable "UK Channel Lineups" and "PA" for that application/API key and SAVE it. Input that API key into mc2xml with -M <apiKey> and you can select a lineup from their regional channel groups. On Windows this can be done through the graphical interface.
    • If you want the iPlayer/4OD/etc url links in the xmltv output you would need to request access to those services for your API key
    • To minimize the amount of data needed to be downloaded you can use an mc2xml.chl text file to limit the number of channels in your lineup, or limit the number of hours of schedule data. Seven days of data for all channels in a lineup is downloaded by default (but can be increased/decreased with the -d <hours> parameter). Data is not cached, so this isn't quick if you are requesting a lot of data and the server is heavily loaded.
    • This service sends data in chunks and mc2xml uses 4 parallel threads if there is a large amount of data (depending on the number of channels/programs/days of schedule you have requested). You can limit this with the --max-threads=# parameter if needed.
    • If you know the atlas channel ids you'd like to download and do not want to use the lineup selection you can use the optional --atlas-channels= parameter to manually specify the comma delimited list of ids (example: --atlas-channels=hkq7,hkrh,hkvb)

TiVo
  • How do I use the TiVo Metadata service?

    • TiVo Metadata is a media API platform with TV listings for many countries (formerly known as Rovi)
    • Sign up and get your trial Consumer Key and Consumer Secret (64 char keys). They are listed in the My Account -> Entitlements section of their website.
    • Select a lineup using a country code and a postal/zip code following the format in the table below (the key/secret/zip/country are saved to the mc2xml.dat file). On Windows this can be done through the graphical interface.
    • This service targets real time interaction rather than bulk downloads. There is a limit on the number of requests one can make per day (10,000 on trial), and most program detail (aside from the title and airing time) must be requested individually per program. This adds up very quickly if you have a lot of channels or hours of schedule data, therefore this service (on trial) is not appropriate for daily collecting of 14 days of schedule data for a full lineup of channels with complete detail.
    • To minimize the amount of data needed to be downloaded you can use an mc2xml.chl text file to limit the number of channels in your lineup, or limit the number of hours of schedule data (using the -d <hours> parameter). 24 hours of data for all channels in a lineup is downloaded by default. Data is not cached, so this isn't quick if you are requesting a lot of data and the server is heavily loaded.
    • This service sends data in chunks and mc2xml uses 4 parallel threads if there is a large amount of data (depending on the number of channels/programs/days of schedule you have requested). You can limit this with the --max-threads=# parameter if needed (Rovi has limited requests per second). The download progress dots can be suppressed with --no-progress
    • This service offers a downloadable template.json file describing the current service URLs to use. There are defaults built in to mc2xml, but you can optionally use this file with the --rovi-template=<template.json> parameter.
    • Because program detail must be requested per program you can specify which additional information you want by appending the appropriate optional command line parameters. Remember, this requests information for every program! (1 http request per program per tag type). If on trial it is recommended to start with a very limited number of channels in your mc2xml.chl file, a low number of -d <hours>, and to use a minimal number of optional command line parameters. (mc2xml will print the number of scheduled programs in the console output so you can calculate how many requests it would take to get the detail you want)

      • --rovi-airing adds program ratings and HD video tags to all programs
      • --rovi-airing_synopses adds program descriptions to all programs
      • --rovi-airing_credits adds program cast credits to all programs

      • --rovi-episode adds categories, year, and season/episode #'s to "episode" program types (requires --rovi-airing)
      • --rovi-movie adds categories and year to "movie" program types (requires --rovi-airing)
      • --rovi-other adds categories and year to "other" program types (requires --rovi-airing)
      • --rovi-series adds categories to "series" program types (requires --rovi-airing)

      Example (after having selected a lineup and created a chl file):
      mc2xml -d 24 -C small.chl --max-threads=1 --rovi-airing_synopses


    • US: mc2xml -r key:secret -U -c us -g 12345
    • CA: mc2xml -r key:secret -U -c ca -g "H0H 0H0"
    • GB: mc2xml -r key:secret -U -c gb -g CF31
    • AG: mc2xml -r key:secret -U -c ag -g 0
    • AR: mc2xml -r key:secret -U -c ar -g A4190
    • AT: mc2xml -r key:secret -U -c at -g 6886
    • AW: mc2xml -r key:secret -U -c at -g 0
    • BB: mc2xml -r key:secret -U -c bb -g 0
    • BE: mc2xml -r key:secret -U -c be -g 1000
    • BM: mc2xml -r key:secret -U -c bm -g 0
    • BO: mc2xml -r key:secret -U -c bo -g 0
    • BR: mc2xml -r key:secret -U -c br -g 01000001
    • BS: mc2xml -r key:secret -U -c bs -g 0
    • CH: mc2xml -r key:secret -U -c ch -g 3303
    • CL: mc2xml -r key:secret -U -c cl -g 1000000
    • CO: mc2xml -r key:secret -U -c co -g 110111
    • CR: mc2xml -r key:secret -U -c cr -g 10101
    • DE: mc2xml -r key:secret -U -c de -g 14050
    • DK: mc2xml -r key:secret -U -c dk -g 9260
    • DO: mc2xml -r key:secret -U -c do -g 10101
    • EC: mc2xml -r key:secret -U -c ec -g 170950
    • ES: mc2xml -r key:secret -U -c es -g 28001
    • FI: mc2xml -r key:secret -U -c fi -g 91980
    • FR: mc2xml -r key:secret -U -c fr -g 38800
    • GD: mc2xml -r key:secret -U -c gd -g 0
    • GT: mc2xml -r key:secret -U -c gt -g 01001
    • HN: mc2xml -r key:secret -U -c hn -g 0
    • IE: mc2xml -r key:secret -U -c ie -g 0
    • IT: mc2xml -r key:secret -U -c it -g 00100
    • JM: mc2xml -r key:secret -U -c jm -g 0
    • LU: mc2xml -r key:secret -U -c lu -g 0
    • MX: mc2xml -r key:secret -U -c mx -g 11500
    • NI: mc2xml -r key:secret -U -c ni -g 0
    • NL: mc2xml -r key:secret -U -c nl -g 1000
    • NO: mc2xml -r key:secret -U -c no -g 0001
    • PA: mc2xml -r key:secret -U -c pa -g 0
    • PE: mc2xml -r key:secret -U -c pe -g 23006
    • PL: mc2xml -r key:secret -U -c pl -g 00-001
    • PT: mc2xml -r key:secret -U -c pt -g 1000
    • SE: mc2xml -r key:secret -U -c se -g 10005
    • SV: mc2xml -r key:secret -U -c sv -g 0
    • TC: mc2xml -r key:secret -U -c tc -g 0
    • TT: mc2xml -r key:secret -U -c tt -g 0
    • VC: mc2xml -r key:secret -U -c vc -g 0
    • VE: mc2xml -r key:secret -U -c ve -g 1010
    • VG: mc2xml -r key:secret -U -c vg -g 0


zap2it
  • How do I use Zap2it?

    • If using the command line, specify the -1 parameter along with -c your selected country code and -g postal/zip code and select a lineup.
    • Optionally append --zap2it-ppv to enable ppv channels
    • Optionally append --zap2it-music to enable music channels
    • Optionally append --zap2it-onlyhd to only download hd channels
    • Use an mc2xml.chl text file to limit the number of channels in your lineup, or limit the number of hours of schedule data (using the -d <hours> parameter) if you want to reduce the amount of download data.
    • Downloading multiple lineups would require the use of multiple .dat files
    • Default is 7 day download (you can change this with the -d <hours> command line parameter).
    • mc2xml uses 2 parallel threads to download 6 hour blocks of listings. You can limit or increase this with the --max-threads=# parameter. The download progress dots can be suppressed with --no-progress Dots: "."=downloaded, "-"=read from cache ","=retry, "x"=failed. If you try to get more data than is available on the servers the download will fail ("Missing data") but the xmltv.xml file will be written with the completed data.
    • Optionally download movie details (more genres, credits) by adding the
      --movie-details parameter, or all program details with
      --all-details. You can limit this to programs broadcasting within the next # hours, ie: 24 with --movie-details=24 or
      --all-details=#.
      Downloading details requires one HTTP request PER series/movie. If your lineup has a lot of channels this can result in a very LARGE number of connections that could burden the server. Most users probably don't need details.
    • Listings are read from the "cache", if available, for 6 hours but are re-downloaded after that to ensure listings are always up to date. This folder is configurable with the --cache=dir parameter. Make sure the "cache" sub folder is writable on your system.
    • Program details don't change so they will remain in the cache until they are not used/read for 2 weeks.
    • The country and postal/zip code formats supported by zap2it are in the following table of examples. On Windows the graphical interface has input boxes for these options.

    • US: mc2xml -1 -c us -g 12345
    • CA: mc2xml -1 -c ca -g H0H0H0



TVGUIDE.com
  • How do I use TVGuide.com?

    • If using the command line, specify the -2 parameter along with -c your selected country code and -g postal/zip code and select a lineup.
    • Use an mc2xml.chl text file to limit the number of channels in your lineup, or limit the number of hours of schedule data (using the -d <hours> parameter) if you want to reduce the amount of download data.
    • Downloading multiple lineups would require the use of multiple .dat files
    • mc2xml uses 2 parallel threads to download 6 hour blocks of listings. You can limit or increase this with the --max-threads=# parameter. The download progress dots can be suppressed with --no-progress Dots: "."=downloaded, "-"=read from cache ","=retry, "x"=failed. If you try to get more data than is available on the servers the download will fail ("Missing data") but the xmltv.xml file will be written with the completed data.
    • Optionally download movie details (more genres, star-rating) by adding the
      --movie-details parameter, or all program details with
      --all-details. You can limit this to programs broadcasting within the next # hours, ie: 24 with --movie-details=24 or
      --all-details=#.
      Downloading details requires one HTTP request PER program/movie. If your lineup has a lot of channels this can result in a very LARGE number of connections that could burden the server. Most users probably don't need details.
    • Optionally download movie credits by adding the
      --movie-credits parameter, or all program credits with
      --all-credits. You can limit this to programs broadcasting within the next # hours, ie: 24 with --movie-credits=24 or
      --all-credits=#.
      Downloading credits requires one HTTP request PER program/movie. If your lineup has a lot of channels this can result in a very LARGE number of connections that could burden the server. Most users probably don't need credits.
    • Listings are read from the "cache", if available, for 6 hours but are re-downloaded after that to ensure listings are always up to date. This folder is configurable with the --cache=dir parameter. Make sure the "cache" sub folder is writable on your system.
    • Program details and credits don't change so they will remain in the cache until they are not used/read for 2 weeks.
    • The country and postal/zip code formats supported by tvguide.com are in the following table of examples. On Windows the graphical interface has input boxes for these options.
    • Note: if you use the "ca" country code it will offer all 5000 country-wide lineups. TVGuide doesn't filter by postal code outside of the US. If using a console make sure it has a large scrollback so you can find your provider number.

    • US: mc2xml -2 -c us -g 12345
    • CA: mc2xml -2 -c ca -g 0

    • AG: mc2xml -2 -c ag -g 0
    • AI: mc2xml -2 -c ai -g 0
    • AR: mc2xml -2 -c ar -g 0
    • AW: mc2xml -2 -c aw -g 0
    • BA: mc2xml -2 -c ba -g 0
    • BB: mc2xml -2 -c bb -g 0
    • BM: mc2xml -2 -c bm -g 0
    • BO: mc2xml -2 -c bo -g 0
    • BR: mc2xml -2 -c br -g 0
    • CL: mc2xml -2 -c cl -g 0
    • CO: mc2xml -2 -c co -g 0
    • CR: mc2xml -2 -c cr -g 0
    • CU: mc2xml -2 -c cu -g 0
    • CW: mc2xml -2 -c cw -g 0
    • DO: mc2xml -2 -c do -g 0
    • EC: mc2xml -2 -c ec -g 0
    • GD: mc2xml -2 -c gd -g 0
    • GT: mc2xml -2 -c gt -g 0
    • GY: mc2xml -2 -c gy -g 0
    • HN: mc2xml -2 -c hn -g 0
    • JM: mc2xml -2 -c jm -g 0
    • KN: mc2xml -2 -c kn -g 0
    • LC: mc2xml -2 -c lc -g 0
    • MF: mc2xml -2 -c mf -g 0
    • MS: mc2xml -2 -c ms -g 0
    • MX: mc2xml -2 -c mx -g 0
    • NI: mc2xml -2 -c ni -g 0
    • NL: mc2xml -2 -c nl -g 0
    • PA: mc2xml -2 -c pa -g 0
    • PE: mc2xml -2 -c pe -g 0
    • SV: mc2xml -2 -c sv -g 0
    • TC: mc2xml -2 -c tc -g 0
    • TT: mc2xml -2 -c tt -g 0
    • VC: mc2xml -2 -c vc -g 0
    • VG: mc2xml -2 -c vg -g 0


tvguide.co.uk
  • How do I use TVGuide.co.uk?

    • If using the command line, specify the -3 parameter. A country/postal code is not required. Select from all lineups available in GB.
    • Use an mc2xml.chl text file to limit the number of channels in your lineup, or limit the number of hours of schedule data (using the -d <hours> parameter) if you want to reduce the amount of download data.
    • Downloading multiple lineups would require the use of multiple .dat files
    • mc2xml uses 2 parallel threads to download 6 hour blocks of listings. You can limit or increase this with the --max-threads=# parameter. The download progress dots can be suppressed with --no-progress Dots: "."=downloaded, "-"=read from cache ","=retry, "x"=failed. If you try to get more data than is available on the servers the download will fail ("Missing data") but the xmltv.xml file will be written with the completed data.
    • Optionally download movie details (more genres, credits) by adding the
      --movie-details parameter, or all program details with
      --all-details. You can limit this to programs broadcasting within the next # hours, ie: 24 with --movie-details=24 or
      --all-details=#.
      Downloading details requires one HTTP request PER program/movie. If your lineup has a lot of channels this can result in a very LARGE number of connections that could burden the server. Most users probably don't need details.
    • Listings are read from the "cache", if available, for 6 hours but are re-downloaded after that to ensure listings are always up to date. This folder is configurable with the --cache=dir parameter. Make sure the "cache" sub folder is writable on your system.
    • Program details don't change so they will remain in the cache until they are not used/read for 2 weeks.
    • The country and postal/zip code formats supported by tvguide.co.uk are in the following table of examples. On Windows the graphical interface has input boxes for these options.

    • GB: mc2xml -3


XBOX
  • How do I use the Xbox OneGuide service?

    • This service requires your Xbox Live account userEmail and password (or you can create another here). It uses your Microsoft Live account, but that account must be activated for use on xboxlive.com. (if you have login problems check their system status for any current issues.)
    • Also run by Microsoft, OneGuide serves a slightly different group of countries than the Media Center services. OneGuide data also provides some season and episode numbers (the xmltv_ns tag in XMLTV) and channel logos, but does not have movie ratings (star-rating) and some other data tags. Some lineups did not have radio stations like the comparable media center listings. You can view the provider lineups and data by clicking on your country code in the following table (MSN online TV listings) Unfortunately MSN has removed these online listings. They can be viewed on the XBOX.
    • Use an mc2xml.chl text file to limit the number of channels in your lineup, or limit the number of hours of schedule data (using the -d <hours> parameter) if you want to reduce the amount of download data.
    • Downloading multiple lineups would require the use of multiple .dat files
    • This service sends data in uncompressed chunks and mc2xml uses 4 parallel threads if there is a large amount of data (depending on the number of channels/programs/days of schedule you have requested). You can limit or increase this with the --max-threads=# parameter. The download progress dots can be suppressed with --no-progress
    • The country and postal/zip code formats supported by the Xbox OneGuide service are in the following table of examples. On Windows the graphical interface has input boxes for these options.


    • US: [mc2xml command] -c us -g 12345
    • CA: [mc2xml command] -c ca -g "H0H 0H0"
    • GB: [mc2xml command] -c gb -g CF31

    • AR: [mc2xml command] -c ar -g 1001
    • AT: [mc2xml command] -c at -g 1010
    • AU: [mc2xml command] -c au -g 0000
    • BE: [mc2xml command] -c be -g 1000
    • BR: [mc2xml command] -c br -g 01000001
    • CH: [mc2xml command] -c ch -g 1000
    • CL: [mc2xml command] -c cl -g 1000000
    • CO: [mc2xml command] -c co -g 200001
    • DE: [mc2xml command] -c de -g 01067
    • DK: [mc2xml command] -c dk -g 1000
    • ES: [mc2xml command] -c es -g 01001
    • FI: [mc2xml command] -c fi -g 10120
    • FR: [mc2xml command] -c fr -g 01000
    • IE: [mc2xml command] -c ie -g 00000
    • IT: [mc2xml command] -c it -g 00010
    • MX: [mc2xml command] -c mx -g 01000
    • NL: [mc2xml command] -c nl -g 1000
    • NO: [mc2xml command] -c no -g 1001
    • PL: [mc2xml command] -c pl -g 11-001
    • PT: [mc2xml command] -c pt -g 1000
    • RU: [mc2xml command] -c ru -g 101000
    • SE: [mc2xml command] -c se -g 10012


  • How do I crop the output of the schedules?

    • Use the -s and/or -d command line parameters (media center listings usually have 14 days worth of data by default). Make note of the "+" and "-" signs!

      mc2xml -s -5 -d 10
      output programs that start later than 5 hours ago, and include only the following 10 hours of programming
      mc2xml -s +5
      output programs that start later than 5 hours from now
      mc2xml -s 5
      output programs that start later than 5 hours after the downloaded listing's start time

  • Can I combine channels from multiple lineups and put them in one xml file?

    • If you are mindful of duplicate channels when creating your .chl files you can save your lineups to different .dat files and then chain them with the "-I xmlfile" insertion parameter

      • mc2xml -D NL.dat -C NL.chl -o NL.xml
      • mc2xml -D UK.dat -C UK.chl -I NL.xml -o UK_NL.xml
      • mc2xml -D DE.dat -C DE.chl -I UK_NL.xml -o DE_UK_NL.xml

    • Example #2 (note: -C file.chl is optional and limits which channels are downloaded and/or output in the xmltv.xml file, see here)

      • mc2xml -D lineup1.dat -C lineup1.chl -o lineup1.xml
      • mc2xml -D lineup2.dat -C lineup2.chl -I lineup1.xml -o lineup1and2.xml

sed
  • How can I customize the listings?

    • It is easy to use sed (sed for windows) to automate the modification of the xmltv.xml text file. Here are some user contributed examples that could be added to the end of your EPG update script/bat file:

    • "Use sed to change the "-b" added asterisks into an [R] for "rerun" (or [N] for "new" when using "-a"). Since news programs usually are classified as reruns you can then change the [R] to NEWS for them. This solution is not perfect due to sed.exe control metacharacters commonly found in xml files, but it is close."

       command line 
      sed.exe -e "/<title lang=/ s/"*"/[R]/g" < "C:\mc2xml\xmltv.xml" > "C:\mc2xml\tvguidetemp.xml"
      sed.exe -e "/.*News.*"[R]"/ s/"[R]"/"NEWS"/g" < "C:\mc2xml\tvguidetemp.xml" > "C:\mc2xml\tvguide.xml"

    • "Add the team names from the sub-title to the title of NBA and College basketball games"
      • sed -f c:\mc2xml\sedscript.txt < c:\mc2xml\xmltv.xml > c:\mc2xml\newxmltv.xml

       sedscript.txt (cut&paste to read more easily)
      :a;N;$!ba;s/\(<programme[^<]*\)\(<t[^>]*>\)\(College Basketball[^<]*\)\(<[^<]*\)\(<sub-title[^>]*>\)\([^<]*\)[^<\/programme]*/\1\2\3: \6\4\5\6/g
      :a;N;$!ba;s/\(<programme[^<]*\)\(<t[^>]*>\)\(NBA Basketball[^<]*\)\(<[^<]*\)\(<sub-title[^>]*>\)\([^<]*\)[^<\/programme]*/\1\2\3: \6\4\5\6/g
      :a;N;$!ba;s/\(<programme[^<]*\)\(<t[^>]*>\)\(MLB Baseball[^<]*\)\(<[^<]*\)\(<sub-title[^>]*>\)\([^<]*\)[^<\/programme]*/\1\2\3: \6\4\5\6/g

    • "Change channel display-name order to match mythtv xmltvparser name callsign channum"
      • sed -f sedscript.txt < /home/mc2xml/xmltv.xml > /home/mc2xml/newxmltv.xml

       sedscript.txt (cut&paste to read more easily)
      :a;N;$!ba;s/\(<channel[^<]*\)\(<display*[^>]*>\)\([^ ]*\) \([^<]*\)\(<\/display-name>*\)/\1\2\4\5\n\t\t\2\4\5/g

    • "Remove all descriptions"

       command line 
      sed "/<desc/d" xmltv.xml > xmltv-nodesc.xml

    • "Change ChannelID of channel 73 to a specific static number"

       command line 
      c:\programs\sed\bin\sed.exe "s/I73\.[^\.]*\.micro/I73\.999999999\.micro/g" c:\mc2xml\xmltv.xml > c:\mc2xml\xmltv-new.xml

    • "Remove the Channel# from ChannelIDs"

       command line 
      c:\programs\sed\bin\sed.exe "s/I[[:digit:]]\+\.\(.*microsoft.com\)/I\1/" c:\mc2xml\xmltv.xml > c:\mc2xml\xmltv-new.xml

    • "Delete all programmes"

       command line 
      c:\programs\sed\bin\sed.exe "/<programme/,/<\/programme/d" c:\mc2xml\xmltv.xml > c:\mc2xml\xmltv-new.xml

    • "Delete some tags to make a smaller xmltv.xml file"

       command line 
      c:\programs\sed\bin\sed.exe "/<icon\|<actor\|<director\|<writer\|<producer\|<presenter\|<credits\|<\/credits/d;" xmltv.xml > xmltv-small.xml


  • Miscellaneous

    • Channel ids are currently a concatenation of number and id, since some listings have duplicate numbers while others have duplicate ids.
    • The linux binary is statically compiled.
    • Error: TCP 124412R = if you use ESET NOD32 Antivirus "Web Access Protection" (or similar) you may need to make an exception for mc2xml if this setting is preventing EPG downloads


  • Comments
  • mc2xml (at) gmail.com
© mc2xml