[mythtv-users] tv_grab_na_dd backport data to .14 system?

William Powers wepprop at sbcglobal.net
Mon May 10 21:37:59 EDT 2004


My original procedure posted earlier did not work out.  I thought I 
could avoid using the --old-chan-id argument to tv_grab_na_dd, but it 
resulted in some subtle but extremely devastating database problems.  In 
this case, the cure is far worse than the disease.  Accordingly, I 
suggest using the following procedure and script, which uses 
--old-chan-id, and which is working much better for me.

To repeat, do not use the procedure and script in my original post.  Rev 
A of the procedure is as follows:

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.

Yes, I know you can avoid all of this by running from CVS.  Anyone who 
wishes to do so has my encouragement.




More information about the mythtv-users mailing list