[mythtv-users] Failed to get TV listings

William Powers wepprop at sbcglobal.net
Sat May 22 01:07:41 EDT 2004


Preston Crow wrote:

> So we have three options:
> 
> 1)  A new 0.15 release of Myth before the listings run out at the end of
> next week.
> 
> 2)  Compile from CVS (which doesn't seem to be working with the obvious
> ./configure;make on my Gentoo system, and the build setup seems to be
> different for some of the modules).
> 
> 3)  Figure out how to use tv_grab_na_dd with 0.14 (and a look through
> some previous threads indicates that this is a challenge at best; if
> someone has it working, please tell us how to do it or point to the
> right posting).
> 

For anyone who prefers Option 3 over Option 2 until 0.15 is released, 
the attached procedure worked for me; I have been using tv_grab_na_dd 
for a couple of weeks now.  The script attached at bottom only supports 
a single zap2it lineup, but if you need multiple lineups, a suitable 
script was posted earlier on this list.  Search for 'mtdean'.

1)  Register at http://labs.zap2it.com using code 'TGYM-ZKOC-BUTV'
      (Letter O, not zero)

2)  Record your new username and password and choose the proper
     lineup and channels.

3)  Update/install all of the XMLTV prereq's (If you're upgrading
     XMLTV from ATrpms, you can skip this step and step 4).

     $ perl -MCPAN -e shell
     cpan> install XML::Twig
     cpan> install Date::Manip
     cpan> install LWP
     cpan> install XML::Writer
     cpan> install SOAP::Lite
     cpan> exit

4)  Download, unpack, build, and install the lastest version of XMLTV.
     Be sure to build tv_grab_na_dd, although that is now the default
     since tv_grab_na has been retired.

5)  Compute your local offset from GMT (UTC), ie:  -0400 from GMT to EDT

6)  With username, password, and GMT offset in hand, and while logged
     in as the same user that will make the DataDirect requests, do:

     $ tv_grab_na_dd --configure

     and answer the questions.

7)  Back up your database per section 21.5 of the HOWTO.

8)  Determine your sourceid.  The easiest way is to use "phpmyadmin" if
     you already have it installed, but this way is pretty easy too:

     # mysql -u mythtv -pmythtv mythconverg
     mysql> select * from videosource;

     Record your sourceid.

     mysql> quit

9)  Install the following script in place of 'mythfilldatabasecron'
     or whatever you use to pull down the listings.  Make sure that
     it is run under the same userid as did the configuration in
     step 6.  Otherwise it won't be able to find the configuration
     file.  Change the sourceid, if necessary, to be the same as
     determined in step 8.

     Note:  This script contains bits and pieces stolen from a lot
     of different places, but most of it is from from Mike Dean's
     post.  If you have multiple lineups to deal with, refer back
     to his post for a method of handling them.  There is also an
     XMLTV utility called tv_cat that can be used to concatenate
     multiple files together after downloading them separately.
     Check the XMLTV source for details.

     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     #!/bin/sh
     #/usr/local/bin/mythfilldatabasecron_dd

     # temporary filename
     dirname='/tmp'
     filename="tv-${RANDOM}${RANDOM}"
     xml_file=${dirname}/${filename}.xml

     # From step 8
     sourceid=1

     # replace all data
     offset=-1

     # How many days worth of guide data to download
     numdays=10

     /usr/bin/tv_grab_na_dd --output ${xml_file} --days ${numdays} \
                            --old-chan-id && \
     /usr/bin/mythfilldatabase --file ${sourceid} ${offset} ${xml_file}

     # Remove the temporary file
     rm ${xml_file}
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the whole thing blows up in your face and you want to back
out of it, execute section 21.6 of the HOWTO to drop the database, and
then run the restore database part of section 21.5 using the backup you 
made in step 7.




More information about the mythtv-users mailing list