View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 166 posts ] 
Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 12  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Re: Grabber broken?
PostPosted: Sat Apr 19, 2008 10:13 pm 
Offline
Joined: Sat Apr 19, 2008 6:37 pm
Posts: 7
krayzie wrote:
deMyth wrote:
ajpalm wrote:
Ralph wrote:
Which grabber are you using?
ajpalm wrote:
2008-04-18 19:16:31.115 Connected to database 'mythconverg' at host: localhost
Failed to fetch http://minnie.tuhs.org/xmltv/channels.xml.gz at /usr/bin/tv_grab_au line 346.
2008-04-18 19:16:31.842 ------------------ End of XMLTV output ------------------

Hi Guys,

All has been working well upto tonight, getting the following error. Appears the script isn't passing my username/password for the download.

If I copy and paste that URL into IE, it prompts for username/password. Entering those in, downloads the file correctly. so the file is there etc.

Anyone else seeing this?

Thanks!


Sorry, using this one

http://www.better-access.com/KM/tv_grab_au


Yes, I am seeing this problem (/usr/bin/tv_grab_au line 346), i have created my own workaround to the problem. I have written a shell script which uses wget to bring down the channel data files to my local myth host, I then point the tv_grab_au script to my server and it works OK. My server doesn't require auth, it is used for mythweb so I didn't have too much work here to get it all going. Let me know if you want help, I am happy to share my workaround.

cheers,
deMyth
----------


deMyth,

can you please post your script

Thanks.


Here is my shell script:
Code:
[mythtv@kingtide bin]$ cat pre_tv_grab_au
#!/bin/bash
#
# Set up my Guide Account Info
guide_username=MyName
guide_password=MyPassword
# Set up my local xmltv web directory
www_dir=/var/www/html/xmltv
# Set  tmp file and log file variables
ts=$(date +%s)
tmp_file=/tmp/tmp_file-$ts
log=/home/mythtv/log/pre_tv_grab_au.log
#
#
        echo ""  > $log
        echo "Start pre_tv_grab_au at $(date)" >> $log
        pushd $www_dir >> $log 2>&1
        touch channels.xml.gz # Protect it from aging
        find . -type f -mtime +30 -name "*.gz" | xargs rm -f  >> $log #Prune old guide data files
        rm index.html *.1 *.2 > /dev/null 2>&1 # Prune any duplicates that wget may create
        wget --http-user=$guide_username --http-password=$guide_password http://minnie.tuhs.org/xmltv/ >> $log 2>&1
        # Parse the index for my channels
        awk '
        BEGIN   { FS=""" }
        {
                if (($6 ~ /^ABC-Vic/) || ($6 ~ /^ABC2/) || \
                        ($6 ~ /^Nine-Mel/)|| ($6 ~ /^SBS-Vic/) || \
                        ($6 ~ /^Ten-Vic/) || ($6 ~ /^Seven-Mel/))
                {
                        print $6
                }
        }
        ' index.html > $tmp_file
        # Download any new channel data files
        while read gz
        do
                if [ ! -e "${www_dir}/${gz}" ]
                then
                        wget --http-user=$guide_username --http-password=$guide_password http://minnie.tuhs.org/xmltv/$gz >> $log 2>&1
                        # Be kind to guide server and pause between file downloads
                        sleep 1
                fi
        done <  $tmp_file
        popd >> $log 2>&1
        rm $tmp_file
        echo ""  >> $log
        echo "End pre_tv_grab_au at $(date)" >> $log
 

I have this script in my /home/mythtv/bin folder. Use chmod +e on this file to flag it executable. Then make a log directory, in my case mkdir /home/mythtv/log. The script will create a log file in this folder.
Then set up you web directory, in my case mkdir /var/www/html/xmltv, do this as root and chown mythtv.mythtv /var/www/html/xmltv to assign ownership on this. Next you edit the existing (http://www.better-access.com/KM/tv_grab_au) grab script to point to your local web server instead of minnie.tuhs.org, in my case http://kingtide/xmltv/, So my two modified lines read:
my $default_root_url = 'http://kingtide/xmltv/channels.xml.gz' and
my $default_root_url = 'http://kingtide/xmltv/channels.xml.gz'
Almost there, your channel data needs to be configured, in my case I live in Melbourne. Modify the pre_tv_grab_au shell script with your username/password and your channels. Then you need to create a channels.xml.gz. so I created a file called /var/www/html/xmltv/channels.xml as shown here:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<tv generator-info-name="Wktivoguide v5">
  <channel id="SBS-Vic">
    <display-name lang="en">SBS Vic</display-name>
    <base-url>http://kingtide/xmltv/</base-url>
  </channel>
  <channel id="Nine-Mel">
    <display-name lang="en">Nine Melbourne</display-name>
    <base-url>http://kingtide/xmltv/</base-url>
  </channel>
  <channel id="ABC-Vic">
    <display-name lang="en">ABC Vic</display-name>
    <base-url>http://kingtide/xmltv/</base-url>
  </channel>
  <channel id="ABC2">
    <display-name lang="en">ABC2</display-name>
    <base-url>http://kingtide/xmltv/</base-url>
  </channel>
  <channel id="Seven-Mel">
    <display-name lang="en">Seven Melbourne</display-name>
    <base-url>http://kingtide/xmltv/</base-url>
  </channel>
  <channel id="Ten-Vic">
    <display-name lang="en">Ten Melbourne</display-name>
    <base-url>http://kingtide/xmltv/</base-url>
  </channel>
</tv>

Then zip it up, cd /var/www/html/xmltv, then gzip channels.xml. To check it do zcat channels.xml.gz.
Now ready to test, so execute the script and check the log file for result. Once you have seeded your local xmltv folder you need to run your modified grabber, do /usr/local/bin/tv_grab_au --configure. This will download from you local server xmltv area and prompt you for username, password, base url and channel info. Here is how my config file looks.
Code:
[mythtv@kingtide .xmltv]$ cat /home/mythtv/.xmltv/tv_grab_au.conf
username=xx
username=yy
root-url=http://kingtide/xmltv/channels.xml.gz
cachedir=/home/mythtv/.mythtv/cache
channel=ABC-Vic
channel=ABC2
channel=Nine-Mel
channel=SBS-Vic
channel=Seven-Mel
channel=Ten-Vic

Now run the grabber /usr/local/bin/tv_grab_au and check it now works.
Then run mythfilldatabase to load in the new guide data to the mythtv database.
Here is my cron entry:
Code:
24 03  * * *     $HOME/bin/runmythfilldatabase > /dev/null 2>&1

and here is my $HOME/bin/runmythfilldatabase script:
Code:
[mythtv@kingtide bin]$ cat runmythfilldatabase
#!/bin/bash
#
export TERM=linux
export PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/mythtv/bin
cd $HOME
$HOME/bin/pre_tv_grab_au
/usr/bin/mythfilldatabase

My setup is running fedora core 6 and my hostname is kingtide.
That is about it, I have just got mine going so I am doing final testing on the cron job.
This is a workaround, so I am wondering if I should use the Shepherd method when I have time to changeover? comments welcome on this.
Anyhow, let me know if you need more help,

Cheers,
deMyth


Top
 Profile  
 
PostPosted: Sat Apr 19, 2008 10:23 pm 
Offline
Joined: Sat Apr 19, 2008 6:37 pm
Posts: 7
Correction, changes to tv_grab_au should read:

my $default_root_url = 'http://kingtide/xmltv/channels.xml.gz'; and
my $url = 'http://kingtide/xmltv/';

kingtide is my servername, use yours in place of mine.

hope this helps.

Cheers,
deMyth
--------


Top
 Profile  
 
 Post subject: Re: Grabber broken?
PostPosted: Sun Apr 20, 2008 3:46 am 
Offline
Joined: Thu Aug 24, 2006 5:45 pm
Posts: 5
ajpalm wrote:
2008-04-18 19:16:31.115 Connected to database 'mythconverg' at host: localhost
Failed to fetch http://minnie.tuhs.org/xmltv/channels.xml.gz at /usr/bin/tv_grab_au line 346.
2008-04-18 19:16:31.842 ------------------ End of XMLTV output ------------------

Hi Guys,

All has been working well upto tonight, getting the following error. Appears the script isn't passing my username/password for the download.

If I copy and paste that URL into IE, it prompts for username/password. Entering those in, downloads the file correctly. so the file is there etc.

Anyone else seeing this?

Thanks!


I am getting this same problem, is there an easy fix other than that complex script work around?


Top
 Profile  
 
 Post subject: Re: Grabber broken?
PostPosted: Sun Apr 20, 2008 4:03 am 
Offline
Joined: Sat Apr 19, 2008 6:37 pm
Posts: 7
dave4 wrote:
ajpalm wrote:
2008-04-18 19:16:31.115 Connected to database 'mythconverg' at host: localhost
Failed to fetch http://minnie.tuhs.org/xmltv/channels.xml.gz at /usr/bin/tv_grab_au line 346.
2008-04-18 19:16:31.842 ------------------ End of XMLTV output ------------------

Hi Guys,

All has been working well upto tonight, getting the following error. Appears the script isn't passing my username/password for the download.

If I copy and paste that URL into IE, it prompts for username/password. Entering those in, downloads the file correctly. so the file is there etc.

Anyone else seeing this?

Thanks!


I am getting this same problem, is there an easy fix other than that complex script work around?


No, I was unable to find a fix, so I wrote this workaround until there is a fix available. Maybe try the Shepherd installation. In my work around I have just another minor correction, should read chmod +x for executable. I have now tested my cron job and looks OK. Good to see I have 7 days of guide info, I was almost out.

deMyth


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 4:53 am 
Offline
Joined: Fri Feb 03, 2006 7:41 am
Posts: 47
Location: Perth Australia
What is the story? Mine is doing this too... just after I thought it was working fine :(

2008-04-20 18:49:21.293 Connected to database 'mythconverg' at host: 192.168.0.3
2008-04-20 18:49:21.295 Grabber Command: nice tv_grab_au --config-file '/home/mythtv/.mythtv/FreeToAir.xmltv' --output /tmp/mythnotM2t --days 1 --offset 1
2008-04-20 18:49:21.295 ----------------- Start of XMLTV output -----------------
Failed to fetch http://minnie.tuhs.org/xmltv/channels.xml.gz at /usr/bin/tv_grab_au line 346.
2008-04-20 18:49:21.826 ------------------ End of XMLTV output ------------------
2008-04-20 18:49:21.827 FAILED: xmltv returned error code 2304.
Error in 1:1: unexpected end of file


Why is it doing this? Surely it only needs a tweak not a full on script hack??!

Cheers

Bj

_________________
Backend/Front : Core2 1.86Ghz 1GBRAM 500GB HDD 32" LCD
Frontend1:VIA M10K Diskless 17" LCD Kitchen
Frontend2:VIA M10K Diskless 22" LCD
Frontend3:Centrino in cubby


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 5:06 am 
Offline
Joined: Sat Apr 19, 2008 6:37 pm
Posts: 7
Bj wrote:
What is the story? Mine is doing this too... just after I thought it was working fine :(

2008-04-20 18:49:21.293 Connected to database 'mythconverg' at host: 192.168.0.3
2008-04-20 18:49:21.295 Grabber Command: nice tv_grab_au --config-file '/home/mythtv/.mythtv/FreeToAir.xmltv' --output /tmp/mythnotM2t --days 1 --offset 1
2008-04-20 18:49:21.295 ----------------- Start of XMLTV output -----------------
Failed to fetch http://minnie.tuhs.org/xmltv/channels.xml.gz at /usr/bin/tv_grab_au line 346.
2008-04-20 18:49:21.826 ------------------ End of XMLTV output ------------------
2008-04-20 18:49:21.827 FAILED: xmltv returned error code 2304.
Error in 1:1: unexpected end of file


Why is it doing this? Surely it only needs a tweak not a full on script hack??!

Cheers

Bj


Would be great if someone can supply a quick hack, I think the perl code is failing to authenticate as it works against my local site with any credentials. I found wget would authenticate so I had to write a script using this until someone can help fix the tv_grab_au perl script or help with a proper alternative.

deMyth


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 5:09 am 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
Bj wrote:
What is the story? Mine is doing this too... just after I thought it was working fine :(


It *was* working fine. I don't know what changed but I suspect the TUHS web server may be blocking it because of some header in the request. I asked Warren about this but he hasn't responded yet. Very annoying for all of us. If not cleared up tomorrow, I may have to recommend that we all go the Shepherd way.

Mike

_________________
*********************
LinHES 7.4
Australian Dragon
*********************


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 6:28 am 
Offline
Joined: Fri Feb 03, 2006 7:41 am
Posts: 47
Location: Perth Australia
I just installed and config'ed Shepherd. What a ripper! The thing is awesome because it's way more accurate - Now this is a brilliant thing 'cause now the missus doesn't whinge about the shows not lining up with "the real things" on tv. 2nd it works.

Lets make this the default because if you can't get data from Oztivo at least something else will fill it in! I love a backup plan!

Here is what I did:

OzTiVo Shepherd Changeover


Cheers

Bj

_________________
Backend/Front : Core2 1.86Ghz 1GBRAM 500GB HDD 32" LCD
Frontend1:VIA M10K Diskless 17" LCD Kitchen
Frontend2:VIA M10K Diskless 22" LCD
Frontend3:Centrino in cubby


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 3:41 pm 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
Hi BJ et al,

I agree with you. I've had two probs with oztivo and don't like the incomplete data thing. We should go to Shepherd.

Thanks for your howto bj, but you didn't need any more than three packages installed, and I think it can be scripted for upgrade.

I also think it should be the default installation for next release.

Will attempt an auto changeover script later today.

Mike

_________________
*********************
LinHES 7.4
Australian Dragon
*********************


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 8:12 pm 
Offline
Joined: Sun Apr 20, 2008 8:00 pm
Posts: 1
In case anyone is still interested, the problem is indeed that the perl code is not authenticating. Replacing the three occurrences of http://minnie.tuhs.org/ in tv_grab_au with http://YOURUSERNAME:YOURPASSWORD\@minnie.tuhs.org/ and the root url in the config file in a similar way (but without the \ before the @) is a quick fix. Not sure exactly that all of those are needed, but it definitely works this way.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 21, 2008 2:08 am 
Offline
Joined: Tue Jan 24, 2006 1:29 am
Posts: 157
Location: Brisbane, Australia
before we add shepherd to the next release, one issue needs addressing:

My status page now alwas reads as follows:

Code:
Last mythfilldatabase run started on 2008-04-21 04:30 and ended on 2008-04-21 04:30. mythfilldatabase ran, but did not insert any new data into the Guide. This can indicate a potential problem with the XML file used for the update.
There's guide data until 2008-04-28 07:00 (7 days).


This may just be because i have 2 seperate sources adn the second one contains no new data. Is anyone with only one source seeing this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 21, 2008 2:20 am 
Offline
Joined: Sat Dec 03, 2005 5:59 pm
Posts: 111
Location: Sydney, Australia
Nope. I also have 2 sources and using Shepherd, but I'm not seeing that. I typically get this:
Code:
Last mythfilldatabase run started on 2008-04-21 14:55 and ended on 2008-04-21 14:57. Successful.
There's guide data until 2008-04-28 15:35 (7 days).

(The reason for the quick runtime (usually one or two minutes) is because it's the output following the second source run, which uses cached data.)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 21, 2008 4:22 pm 
Offline
Joined: Sat Apr 19, 2008 6:37 pm
Posts: 7
TNV wrote:
In case anyone is still interested, the problem is indeed that the perl code is not authenticating. Replacing the three occurrences of http://minnie.tuhs.org/ in tv_grab_au with http://YOURUSERNAME:YOURPASSWORD\@minnie.tuhs.org/ and the root url in the config file in a similar way (but without the \ before the @) is a quick fix. Not sure exactly that all of those are needed, but it definitely works this way.


Thanks for your help with this simple hack, seems like the minnie.tuhs.org was not enforcing authentication until mid last week when I noticed the problem. I put my shell script workaround to rest and spent time last night setting up shepherd. It works well, although I couldn't get the cpan JavaScript to complete. I caught up with a mate yesterday who also created his own workaround to the problem, he used curl with auth params:
.
Code:

    #my $compressed = get( $url )
    #    or die "Failed to fetch $url (and if anybody cares; cachedir = '".$conf->{cachedir}->[0]."')";

    open urlHandle, "curl -u $username:$password http://minnie.tuhs.org/xmltv/channels.xml.gz |" or die $!;
    my @finLines = <urlHandle>;
    my $compressed = join("", @finLines);



funny how a broken tv grabber script brings script hackers out of the woodwork.

Cheers,
deMyth


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 21, 2008 5:24 pm 
Offline
Joined: Sat Dec 03, 2005 5:59 pm
Posts: 111
Location: Sydney, Australia
deMyth wrote:
spent time last night setting up shepherd. It works well, although I couldn't get the cpan JavaScript to complete.
I have the same issue with Shepherd, tried all sorts of ways to get JavaScript.pm to complete but to no avail :? It only affects the running of the Rex grabber though. If you ever work out how to get that pm installed properly please post.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 21, 2008 7:03 pm 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
deMyth wrote:
funny how a broken tv grabber script brings script hackers out of the woodwork.


Yes, truly hilarious! :-)

I fixed my script to use wget rather than curl. Also, the fix mentioned earlier only allows the retrieval of the channel listing. I applied the wget mod for the data also.

The new script is at http://www.better-access.com/KM/tv_grab_au
The diff is as above, but append .diff

I tested it, and it works quite well. The next version of KM won't have my Perl script, though (my setup scripts choose Shepherd as the oztivo default).
The reason is this: My script totally relies on oztivo's people telling me when they change something (which they don't) and there is no redundancy. You have the choice, but I'll be sticking with Shepherd for now.

Cheers

Mike

_________________
*********************
LinHES 7.4
Australian Dragon
*********************


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 166 posts ] 
Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 12  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu