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

Gerald Schepens schepens at shaw.ca
Mon May 10 23:33:53 EDT 2004


Here's a version of the file that is intended to grab data from two 
different lineups, one from standard cable and the other from digital.  
I hope you can comment on whether this script will work.

-------------------------------------------------------------------------------

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

# temporary filename
dirname='/tmp'
filename="tv-${RANDOM}${RANDOM}"
xml_file_a=${dirname}/${filename}_a.xml
xml_file_b=${dirname}/${filename}_b.xml
dd_file=${dirname}/${filename}_dd.xml

# Should be 1 after step 7...
asourceid=1
bsourceid=2

# replace all data
offset=-1

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

/usr/bin/tv_grab_na_dd --config-file=/etc/analog.dat --output 
${xml_file_a} --days ${numdays} --old-chan-id --dd-data=${dd_file}
/usr/bin/tv_grab_na_dd --config-file=/etc/digital.dat --output 
${xml_file_b} --days ${numdays} --old-chan-id --dd-data=${dd_file} 
--reprocess
/usr/bin/mythfilldatabase --file ${asourceid} ${offset} ${xml_file_a}
/usr/bin/mythfilldatabase --file ${bsourceid} ${offset} ${xml_file_b}

# Remove the temporary file
rm ${xml_file_a}
rm ${xml_file_b}
rm ${dd_file}

-------------------------------------------------------------------------------

William Powers wrote:

> 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.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>mythtv-users mailing list
>mythtv-users at mythtv.org
>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>  
>



More information about the mythtv-users mailing list