An easier approach is to use channel_icons.pl a new feature in the post-0.20-SVN trunk of MythTV to quickly look up the information. Doing so requires the MythTV Perl bindings (which can be compiled/installed by passing the "--with-bindings=perl" argument to the MythTV configure script). However, the script requires Perl bindings from SVN trunk. So, if you're using 0.20-fixes, please see the MythTV HOWTO.
If you have the appropriate MythTV Perl bindings, checkout the required scripts with:
svn co http://svn.mythtv.org/svn/trunk/mythtv/contrib/master_iconmap
Doing so will create a directory called "master_iconmap" underneath the current directory. The master_iconmap directory contains a file called "channel_icons.pl", which can be used to retrieve channel icon information. See http://www.gossamer-threads.com/lists/mythtv/commits/255099#255099 and "./master_iconmap/channel_icons.pl --usage" for more information.