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, 2, 3, 4, 5 ... 12  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Fri Mar 14, 2008 3:05 am 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
OK, I have something for you to test :-)

The new tv_grab_au is at http://www.better-access.com/KM/tv_grab_au
Config file looks like this:
Code:
username=<oztivo username>
password=<oztivo password>
root-url=http://minnie.tuhs.org/xmltv/channels.xml.gz
cachedir=/home/mythtv/.mythtv/cache
channel=ABC-Vic
channel=ABC2
channel=Nine-Mel
channel=SBS-Vic
channel=SBSHD-Vic
channel=SBSWN
channel=Seven-Mel
channel=SevenHD
channel=Ten-Vic
channel=TenHD


Obviously, change these for your own xmltvids (only really necessary if you don't live in Melbourne, Geelong, surf coast, whatever).

You can create the config file by running the following code as user mythtv:
Code:
USERNAME=<oztivo username>
PASSWORD=<oztivo passwd>
CHANNELS="/home/mythtv/.mythtv/channels"
CONFIGFILE="/home/mythtv/.mythtv/digital.xmltv"
CACHEDIR="/home/mythtv/.mythtv/cache"
mkdir $CACHEDIR
wget -q -O $CHANNELS "http://$USERNAME:$PASSWORD@minnie.tuhs.org/tivo-bin/xmlmystations.pl"
echo "username=$USERNAME" > $CONFIGFILE
echo "password=$PASSWORD" >> $CONFIGFILE
echo 'root-url=http://minnie.tuhs.org/xmltv/channels.xml.gz' >> $CONFIGFILE
echo "cachedir=$CACHEDIR" >> $CONFIGFILE
for i in `awk -F: '{print $1}' $CHANNELS`
do
    echo "channel=$i" >> $CONFIGFILE
done


Feedback is welcome

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 8:55 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Gday Mike. Thanks for your work on this. I just tried your tv_grab_au with the --configure option and it started asking me which channels I wanted. Given that this information is entered as part of your oztivo registration, would it be better just to query your registration details during a --configure in the same way that your code fragment shows? Then all you would need to enter is your username password.


Last edited by Greg Frost on Fri Mar 14, 2008 9:25 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 9:08 pm 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
Greg Frost wrote:
I just tried your tv_grab_au with the --configure option and it started asking me which channels I wanted. Given that this information is entered as part of your subscription, would it be better just to query your subscription during a --configure in the same way that your code fragment shows? Then all you would need to enter is your username password.


Hi Greg,

No worries :-)
Yes, I only ever did a --configure to see the conf file format, then wrote the code in the previous post to generate the right one without having to select from the billion channels available (which takes waaay too long).

There's another perl grabber called tv_grab_oztivo, which I just couldn't get to run at all on any Debian based distro. It has a heap of dependencies and needs the latest version of perl to run at all. It's not right for Knoppmyth, IMO, which is why I wrote mine.
Mine's based on the one from Sweden, with the credential stuff added, and a few other tweaks and fixes.

Cheers

Mike

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 9:25 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Mike, I configured using your code fragment above which produced the following ~/.mythtv/digital.xmltv
Code:
username=xxx
password=xxx
root-url=http://minnie.tuhs.org/xmltv/channels.xml.gz
cachedir=/home/mythtv/.mythtv/cache
channel=ABC-SA
channel=ABC2
channel=Nine-SA
channel=NineHD
channel=SBS-NEWS
channel=SBS-SA
channel=Seven-SA
channel=SevenHD
channel=Ten-SA
channel=TenHD

Then when I ran your tv_grab_au I got this:
Code:
mythtv@mythtv:~/.mythtv$ ~root/tv_grab_au
<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
<tv>
Can't use an undefined value as an ARRAY reference at /root/tv_grab_au line 173.
mythtv@mythtv:~/.mythtv$


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 14, 2008 9:37 pm 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
Greg Frost wrote:
Then when I ran your tv_grab_au I got this:
Code:
mythtv@mythtv:~/.mythtv$ ~root/tv_grab_au
<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
<tv>
Can't use an undefined value as an ARRAY reference at /root/tv_grab_au line 173.
mythtv@mythtv:~/.mythtv$


Hi Greg,

Since you're running it directly (rather than copying to /usr/bin/tv_grab_au and running mythfilldatabase), you'll have to specify the config file.

Try
Code:
~root/tv_grab_au --config-file /home/mythtv/.mythtv/digital.xmltv


Also, be prepared: Since tv_grab_au is designed to output to stdout (for mythfilldatabase), you'll probably want to interrupt its output.

Mike

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 5:23 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Hello again Mike,
I finally got a chance to see why your grabber wasn't working for me. My input source is called Television instead of digital, so I had the wrong config file name.

So now it's working, I am back to the problem I had with my old method of getting the oztivo data, the time offset for ABC2 and the HD channels is half an hour out (ahh sunny old Adelaide... so much more than half an hour behind)

My old script used sed to do a replacement something like this:
Code:
sed '/channel="abc2.abc.gov.au"/s/" stop="/ -0030" stop="/g' |
  sed '/channel="abc2.abc.gov.au"/s/" channel="/ -0030" channel="/g' |
but I'm perl illiterate and wouldn't know how to do this with your script.

There is a setting in the channel setup for an xmltv offset but it says it only works for the datadirect grabber (and I tried it and it doesnt work with yours). I looked in the channel table and it appears to be a field called tmoffset which is supposed to be a time offset in minutes. Would you be able to update your grabber so that it reads the offset from the channel table and applied it selectively on a channel basis?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 4:38 pm 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
Greg Frost wrote:
So now it's working, I am back to the problem I had with my old method of getting the oztivo data, the time offset for ABC2 and the HD channels is half an hour out (ahh sunny old Adelaide... so much more than half an hour behind)
Would you be able to update your grabber so that it reads the offset from the channel table and applied it selectively on a channel basis?


Hi Greg,

Thanks for testing it :-)

Yes, I'll have a look at it tonight when I get home.

Hope it's not too hot today in Adelaide!

Mike

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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 6:14 am 
Offline
Joined: Fri Feb 03, 2006 7:41 am
Posts: 47
Location: Perth Australia
Sweet as it works fine on my rig R5B27, I do need the offset thing though as I'm in perth and also use the Sydney ABC2 lookup like the old one did

<channel display="ABC2" tvguide="ABC2" channeltz="-0200"/>

Thanks for making an effort for those of us that don't know how!

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: Worked for me
PostPosted: Thu Mar 20, 2008 7:44 am 
Offline
Joined: Mon Oct 24, 2005 8:37 am
Posts: 27
Thanks for the updated script.

For the less experienced or those like me with old-timers disease.

digital is the name of the tuner in the mythtv setup. I have 2 tuners so I created 2 symbolic links to digital.xmltv thus
ln -s /home/myth/.mythtv/digital.xmltv /home/myth/.mythtv/C0T0.xmltv
ln -s /home/myth/.mythtv/digital.xmltv /home/myth/.mythtv/C0T0.xmltv
This gives me 1 config file for the 2 tuners. I put the script in /home/mythtv/tv_grab_au/tv_grab_au_new. Then as root I created another symbolic link
ln -s /home/mythtv/tv_grab_au/tv_grab_au_new /usr/local/bin/tv_grab_au

Worked like a bought one :D :D :D

_________________
Hardware
AMD Sempron
Gigabyte 2004RZ
ATI Radeon 9250
Hauppage PVR-150 (x2)
Leadtek DTV2000H
Software
R5A16 upgraded to R5C7 upgraded to R5E50 now R5.5


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 29, 2008 4:26 am 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
Just to make searching easier I am making a post with Australia in it.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 29, 2008 11:34 pm 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
Bj wrote:
Sweet as it works fine on my rig R5B27, I do need the offset thing though as I'm in perth and also use the Sydney ABC2 lookup like the old one did

<channel display="ABC2" tvguide="ABC2" channeltz="-0200"/>

Thanks for making an effort for those of us that don't know how!

Cheers

Bj


OK, I've had a quick look at this. The problem is that oztivo's ABC2 guide is hard coded with the Sydney/Melbourne/Tasmania timezone (currently +1100 as per below:
Code:
<programme start="20080321000000 +1100" stop="20080321060000 +1100" channel="ABC2">


Since ABC2 doesn't actually broadcast to the whole country at the same time, we certainly do need an offset for this for a couple of particular stations (SBSWN and the new HD stations are the others that come to mind).

Ideally, there should be a different ABC2 listing for WA, SA and NT (and probably QLD during the Summer, as they don't do daylight savings).

I haven't been able to find an easy (documented) way of skewing listing times for certain stations, but since the guide data stops tomorrow, here's how to manually download and adjust them using Unix command line tools:
Copy the following into a file called "getABC2list.py" - this just calculates the file names for the next seven days
Code:
import datetime# need this for calculating the next 7 days' dates
for k in range(7):
    aDay=str(datetime.date.today()+datetime.timedelta(k))
    print "ABC2_"+aDay+".xml.gz"

I'd do it in bash but python is just too easy.

Next, we make the corrected file. Make a new file "correctABC2.sh" and copy this in (replace the username and password):
Code:
NEWOFFSET='+0900'
USER="username"
PASSWD="password"
BASEURL="http://$USER:$PASSWD@minnie.tuhs.org/xmltv/"
for i in `python ./getABC2.py`
do
  if [ ! -f "$i" ]
  then wget "$BASEURL$i"
  fi
done
for j in `ls -1 ./*.xml.gz`
do
  zcat $j | sed "s/\+1100/$NEWOFFSET/g" > $j.xml
done
for k in `ls -1 ./*.xml`
do
  mythfilldatabase --file 1 -1 $k
done

Not great coding, but it'll perform the correction. Make sure you've changed that +0900 to whatever you need it to be. Sydney is +1100 until next Sunday morning.

Run the script with "bash correctABC2.sh"

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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 30, 2008 12:52 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Do you know if it is legal to specify 2 offsets such that each entry looks something like this?
Code:
<programme start="20080321000000 +1100 -0030" stop="20080321060000 +1100 -0030" channel="ABC2">

If that was doable, then your oztivo script could interrogate the db to determine if an extra offset was specified in the channel setup, and apply it.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 30, 2008 1:17 am 
Offline
Joined: Sun Aug 28, 2005 7:07 pm
Posts: 821
Location: Melbourne, Australia
Greg Frost wrote:
Do you know if it is legal to specify 2 offsets such that each entry looks something like this?
Code:
<programme start="20080321000000 +1100 -0030" stop="20080321060000 +1100 -0030" channel="ABC2">

If that was doable, then your oztivo script could interrogate the db to determine if an extra offset was specified in the channel setup, and apply it.


I'm pretty sure that wouldn't be OK Greg. I'm no xml parser expert, but it would probably lead to an error (you could have a go and tell us what happens).

Good idea about the querying, but should be possible to add to the config file something like the offset so it overrides the value in the data files.

I'll look into it now and get back to you: Been looking at this for a while now.

More soon

Mike

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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 30, 2008 1:51 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
I still think it would be better to query because there is a place to edit the offset in the channel setup in mythtv-setup. It would seem a shame to have to also have another offset in the grabber config file. You can do something like this to get the time offset in the database:
Code:
mysql mythconverg -u mythtv --password=mythtv -e "select tmoffset from channel where xmltvid='ABC2'"


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 30, 2008 2:25 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
I can now confirm that adding a second offset to the program start and stop time does not appear to work :cry:. No error reported, but the data does not get adjusted by the second offset.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 166 posts ] 
Go to page Previous  1, 2, 3, 4, 5 ... 12  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 9 guests


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:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu