XMLTV IDs for Comcast Cable
With the “Digital Switch” of Comcast my beloved MythTV setup went bananas. In particular, the channels lineup is all wrong and does not match anymore with what SchedulesDirect provides so I will have to set the channels manually.
To do that, you need to use the web-interface of MythTV and manually set the appropriate XMLTV IDs for each channel. There are various sources of those one of which is the online TV guide Zap2.
I quickly created a Perl script to extract the channels/XMLTVids from their HTML. Here below you will find the lineup extracted (for Comcast in Denver, CO) and the script that I wrote.
Comcast Lineup XMLTV IDs for Denver, CO
2 10816 KWGN 3 10758 KCDO 4 10380 KCNC 5 10748 KTVD 6 10669 KRMA 7 10567 KMGH 8 22221 GOAC008 9 10780 KUSA 10 10371 KCEC 11 18082 KDEN 12 10342 KBDI 13 10422 KDVR 14 16550 KTFD 15 45874 KZCOLP 16 11150 DSC 17 10771 KPXC 18 11867 TBS 19 23694 LEAC019 21 10269 HSN 22 22136 EDAC022 23 10986 MTV 24 11207 USA 25 44263 ALTSPRT 26 11059 FSR 27 14753 FXP 28 11006 NIK 29 12510 DISNP 30 16331 APL 31 18151 TOONP 32 11158 TLC 33 10093 ABCF 34 10179 ESPN 35 12444 ESPN2 36 14771 HISTORY 37 10145 HLN 38 10142 CNN 39 14902 HGTV 40 11164 TNT 41 10035 AETV 42 16374 FNC 43 10918 LIFE 45 11187 TWC 46 10139 CNBC 47 12574 FOOD 48 11097 SYFY 53 10818 KETD 54 23529 PUAC054 55 11069 QVC 59 11163 SPIKETV 61 23736 LEAC061 61 10057 BRAVO 63 22177 EDAC063 66 11218 VH1 67 12852 TCM 68 17561 EP 69 14899 GOLF 70 11221 HALL 72 10150 COMEDYP 73 15952 VERSUS 74 11180 TRAV 75 10222 GALA 77 16011 SPEED 78 16123 TVLAND 95 10051 BET 98 10161 CSPAN 99 17098 WGNAMER
Perl Script to Extract Lineup from Zap2
#!/usr/bin/perl -w
# ----------------------------------------------------------------------
use LWP::UserAgent;
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
my $lineupID = 'CO05419';
my $zipcode = '80302';
# ----------------------------------------------------------------------
########################################################################
my $agent = new LWP::UserAgent(
agent => 'Firefox/3.0',
timeout => 5
);
my $url = "http://tvlistings.zap2it.com/tvlistings/ZCGrid.do?method=decideFwdForLineup&zipcode=$zipcode&setMyPreference=false&lineupId=$lineupID:-";
my $response = $agent->get($url) or die 'Problems downloading lineup';
my $html = $response->content();
while ($html =~ /<span><a href="\/tvlistings\/ZCSGrid.do\?stnNum=(\d+)&channel=(\d+)">(.+?)<\/a>/gis) {
printf("%3d %5d %s\n", $2, $1, $3);
}
########################################################################
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

