Mailing List Archive

tv_grab_nz-py configuration issues
Seeing recent list comments on this, I've been motivated to have another
go at getting it working...

I'm having trouble using the --configure option for the first run, as it
seems to be choking on a non-ascii character - the macron in Maori, near
as I can tell.

_______________

File "tv_grab_nz-py", line 226, in <module>
use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1],
channel[0]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in
position 13: ordinal not in range(128)
_______________

Is this a result of my own locale setup, or something within the script?

Alternatively, if someone can send me the config file they are using and
let me know where it should 'live', I could do it that way...

Thanks for your help.

Nick W.
Tauranga


_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Thu, Dec 5, 2013 at 9:06 AM, Nick Wallingford <nickw@beekeeping.co.nz> wrote:
> Seeing recent list comments on this, I've been motivated to have another go
> at getting it working...
>
> I'm having trouble using the --configure option for the first run, as it
> seems to be choking on a non-ascii character - the macron in Maori, near as
> I can tell.
>
> _______________
>
> File "tv_grab_nz-py", line 226, in <module>
> use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1], channel[0]))
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in
> position 13: ordinal not in range(128)
> _______________
>
> Is this a result of my own locale setup, or something within the script?
>
> Alternatively, if someone can send me the config file they are using and let
> me know where it should 'live', I could do it that way...
>
> Thanks for your help.

Same reult here on a fresh install.

The config file lives in (if you are using *buntu)

~mythtv/.mythtv/XXXX.xmltv

where XXXX is the name of your video source, so mine is

~mythtv/.mythtv/FreeviewHD.xmltv

Unfortunately I don't have a sample right now and cannot recall the
exact format, but essentially it s series of lines of text, one for
each channel like:

channel=tv1.freeviewnz.tv
channel!chinesetv.freeviewnz.tv

Where = signifies you want that data, ! signifies that you don't.
However, as I say I am not sure that is the exact syntax until I get
home and look at the file there.


>
> Nick W.
> Tauranga
>
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On 05/12/13 09:26, Nick Rout wrote:
> channel=tv1.freeviewnz.tv
> channel!chinesetv.freeviewnz.tv
>
> Where = signifies you want that data, ! signifies that you don't.
> However, as I say I am not sure that is the exact syntax until I get
> home and look at the file there.

That is correct, you only really need the = lines, not having a line is
basically the same as having a ! line.

Looks like tv_grab_nz-py can't handle the unicode characters and needs
an update.

hads
--
http://nice.net.nz

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Thu, 05 Dec 2013 09:32:32 +1300, you wrote:

>On 05/12/13 09:26, Nick Rout wrote:
>> channel=tv1.freeviewnz.tv
>> channel!chinesetv.freeviewnz.tv
>>
>> Where = signifies you want that data, ! signifies that you don't.
>> However, as I say I am not sure that is the exact syntax until I get
>> home and look at the file there.
>
>That is correct, you only really need the = lines, not having a line is
>basically the same as having a ! line.
>
>Looks like tv_grab_nz-py can't handle the unicode characters and needs
>an update.
>
>hads

I did the patches suggested here by Robin Gilks to my copy at some
point - I forget what problem they fixed, but it might have been this
one. I know I needed the fixes. Here is the diff:

root@mypvr:/usr/local/bin# diff tv_grab_nz-0.2.6a-py tv_grab_nz-py
23,25c23
< VERSION = '0.2.6a'
< # Modified by J S Worthington to work with Python 2.7 according to
mods by
< # Robin Gilks posted to the mythtvnz@lists.linuxnut.co.nz mailing
list.
---
> VERSION = '0.2.6'
29c27
< 'http://nzepg.org/freeview.xml.gz',
---
> 'http://epg.org.nz/freeview.xml.gz',
212,213c210
< parser = ElementTree.XMLParser(encoding="ISO-8859-1")
< doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
---
> doc = ElementTree.parse(StringIO(text)).getroot()
264,265c261
< parser = ElementTree.XMLParser(encoding="ISO-8859-1")
< doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
---
> doc = ElementTree.parse(StringIO(text)).getroot()

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Thu, Dec 5, 2013 at 1:49 PM, Stephen Worthington
<stephen_agent@jsw.gen.nz> wrote:
> On Thu, 05 Dec 2013 09:32:32 +1300, you wrote:
>
>>On 05/12/13 09:26, Nick Rout wrote:
>>> channel=tv1.freeviewnz.tv
>>> channel!chinesetv.freeviewnz.tv
>>>
>>> Where = signifies you want that data, ! signifies that you don't.
>>> However, as I say I am not sure that is the exact syntax until I get
>>> home and look at the file there.
>>
>>That is correct, you only really need the = lines, not having a line is
>>basically the same as having a ! line.
>>
>>Looks like tv_grab_nz-py can't handle the unicode characters and needs
>>an update.
>>
>>hads
>
> I did the patches suggested here by Robin Gilks to my copy at some
> point - I forget what problem they fixed, but it might have been this
> one. I know I needed the fixes. Here is the diff:

I think that's kinda the wrong way around? I take it you are adding
the ISO-8859 bits, not taking them out. I was always taught "diff
oldfile newfile".

>
> root@mypvr:/usr/local/bin# diff tv_grab_nz-0.2.6a-py tv_grab_nz-py
> 23,25c23
> < VERSION = '0.2.6a'
> < # Modified by J S Worthington to work with Python 2.7 according to
> mods by
> < # Robin Gilks posted to the mythtvnz@lists.linuxnut.co.nz mailing
> list.
> ---
>> VERSION = '0.2.6'
> 29c27
> < 'http://nzepg.org/freeview.xml.gz',
> ---
>> 'http://epg.org.nz/freeview.xml.gz',
> 212,213c210
> < parser = ElementTree.XMLParser(encoding="ISO-8859-1")
> < doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
> ---
>> doc = ElementTree.parse(StringIO(text)).getroot()
> 264,265c261
> < parser = ElementTree.XMLParser(encoding="ISO-8859-1")
> < doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
> ---
>> doc = ElementTree.parse(StringIO(text)).getroot()
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Thu, 5 Dec 2013 15:21:25 +1300, you wrote:

>On Thu, Dec 5, 2013 at 1:49 PM, Stephen Worthington
><stephen_agent@jsw.gen.nz> wrote:
>> On Thu, 05 Dec 2013 09:32:32 +1300, you wrote:
>>
>>>On 05/12/13 09:26, Nick Rout wrote:
>>>> channel=tv1.freeviewnz.tv
>>>> channel!chinesetv.freeviewnz.tv
>>>>
>>>> Where = signifies you want that data, ! signifies that you don't.
>>>> However, as I say I am not sure that is the exact syntax until I get
>>>> home and look at the file there.
>>>
>>>That is correct, you only really need the = lines, not having a line is
>>>basically the same as having a ! line.
>>>
>>>Looks like tv_grab_nz-py can't handle the unicode characters and needs
>>>an update.
>>>
>>>hads
>>
>> I did the patches suggested here by Robin Gilks to my copy at some
>> point - I forget what problem they fixed, but it might have been this
>> one. I know I needed the fixes. Here is the diff:
>
>I think that's kinda the wrong way around? I take it you are adding
>the ISO-8859 bits, not taking them out. I was always taught "diff
>oldfile newfile".
>
>>
>> root@mypvr:/usr/local/bin# diff tv_grab_nz-0.2.6a-py tv_grab_nz-py
>> 23,25c23
>> < VERSION = '0.2.6a'
>> < # Modified by J S Worthington to work with Python 2.7 according to
>> mods by
>> < # Robin Gilks posted to the mythtvnz@lists.linuxnut.co.nz mailing
>> list.
>> ---
>>> VERSION = '0.2.6'
>> 29c27
>> < 'http://nzepg.org/freeview.xml.gz',
>> ---
>>> 'http://epg.org.nz/freeview.xml.gz',
>> 212,213c210
>> < parser = ElementTree.XMLParser(encoding="ISO-8859-1")
>> < doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
>> ---
>>> doc = ElementTree.parse(StringIO(text)).getroot()
>> 264,265c261
>> < parser = ElementTree.XMLParser(encoding="ISO-8859-1")
>> < doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
>> ---
>>> doc = ElementTree.parse(StringIO(text)).getroot()

Oops! I don't use diff often - I normally use my GUI tools. Try
this:

root@mypvr:/usr/local/bin# diff tv_grab_nz-py tv_grab_nz-0.2.6a-py
23c23,25
< VERSION = '0.2.6'
---
> VERSION = '0.2.6a'
> # Modified by J S Worthington to work with Python 2.7 according to mods by
> # Robin Gilks posted to the mythtvnz@lists.linuxnut.co.nz mailing list.
27c29
< 'http://epg.org.nz/freeview.xml.gz',
---
> 'http://nzepg.org/freeview.xml.gz',
210c212,213
< doc = ElementTree.parse(StringIO(text)).getroot()
---
> parser = ElementTree.XMLParser(encoding="ISO-8859-1")
> doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
261c264,265
< doc = ElementTree.parse(StringIO(text)).getroot()
---
> parser = ElementTree.XMLParser(encoding="ISO-8859-1")
> doc = ElementTree.parse(StringIO(text), parser=parser).getroot()

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
tv_grab_nz-py configuration issues [ In reply to ]
Hi

Apologies if this has been answered before, I had a search through the
archive but couldn't find a working answer.

I downloaded the latest tv_grab_nz-py from nice.net.nz and made the
adjustments mentioned by stephen in this thread:
http://www.gossamer-threads.com/lists/mythtv/mythtvnz/559187

From:
doc = ElementTree.parse(StringIO(text)).getroot()
----
To:
parser = ElementTree.XMLParser(encoding="ISO-8859-1")
doc = ElementTree.parse(StringIO(text), parser=parser).getroot()

But it still dies in the configuration for me when it gets to Marori TV
with the unicodeEncodeError .

Is there anything else I am missing?
Running Ubuntu 12.04LTS Server (fresh install) with tvheadend and xbmc


Cheers


Andrew
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Wed, 2013-12-18 at 11:28 +1300, Andrew Taylor wrote:
> Hi
>
>
> Apologies if this has been answered before, I had a search through the
> archive but couldn't find a working answer.
>
>
> I downloaded the latest tv_grab_nz-py from nice.net.nz and made the
> adjustments mentioned by stephen in this thread:
> http://www.gossamer-threads.com/lists/mythtv/mythtvnz/559187
>
>
> From:
> doc = ElementTree.parse(StringIO(text)).getroot()
> ----
> To:
> parser = ElementTree.XMLParser(encoding="ISO-8859-1")
> doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
>
>
>
> But it still dies in the configuration for me when it gets to Marori
> TV with the unicodeEncodeError .
>
>
> Is there anything else I am missing?
> Running Ubuntu 12.04LTS Server (fresh install) with tvheadend and xbmc
>
>
>
>
> Cheers
>
>
>
>
> Andrew
>
I have no idea if this is relevant or not, but ISO-8859-1 usually means
the old windows-1252 character set, which probably doesn't support Maori
specific characters. Does UTF-8 encoding work any better??

Cheers,


Steve

--
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa


_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On 18/12/13 11:28, Andrew Taylor wrote:

> I downloaded the latest tv_grab_nz-py from nice.net.nz
> <http://nice.net.nz> and made the adjustments mentioned by stephen in
> this thread: http://www.gossamer-threads.com/lists/mythtv/mythtvnz/559187
>
> From:
> doc = ElementTree.parse(StringIO(text)).getroot()
> ----
> To:
> parser = ElementTree.XMLParser(encoding="ISO-8859-1")
> doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
>
> But it still dies in the configuration for me when it gets to Marori TV
> with the unicodeEncodeError .

I did a little bit ('little bit!') of a workaround to get past the
config problem.

I downloaded the xml file and edited out the offending entry - it was
the macron for Maori, as others have indicated. I uploaded that file to
my own server. Edited the script so it would grab the xml from my
server. And then I was able to do the config without error. Then just
changed the script back to look at the right spot for the regular
downloading...

Far from elegant, but I wasn't able to get past the python necessary to
get it going 'the right way'.

Nick
Tauranga

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
Hi Steve

I gave it a go... but no luck...
Traceback (most recent call last):
File "./tv_grab_nz-py", line 227, in <module>
use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1], channel[0]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in
position 13: ordinal not in range(128)

Cheers

A.


On 18 December 2013 13:46, Steve Holdoway <steve@greengecko.co.nz> wrote:

> On Wed, 2013-12-18 at 11:28 +1300, Andrew Taylor wrote:
> > Hi
> >
> >
> > Apologies if this has been answered before, I had a search through the
> > archive but couldn't find a working answer.
> >
> >
> > I downloaded the latest tv_grab_nz-py from nice.net.nz and made the
> > adjustments mentioned by stephen in this thread:
> > http://www.gossamer-threads.com/lists/mythtv/mythtvnz/559187
> >
> >
> > From:
> > doc = ElementTree.parse(StringIO(text)).getroot()
> > ----
> > To:
> > parser = ElementTree.XMLParser(encoding="ISO-8859-1")
> > doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
> >
> >
> >
> > But it still dies in the configuration for me when it gets to Marori
> > TV with the unicodeEncodeError .
> >
> >
> > Is there anything else I am missing?
> > Running Ubuntu 12.04LTS Server (fresh install) with tvheadend and xbmc
> >
> >
> >
> >
> > Cheers
> >
> >
> >
> >
> > Andrew
> >
> I have no idea if this is relevant or not, but ISO-8859-1 usually means
> the old windows-1252 character set, which probably doesn't support Maori
> specific characters. Does UTF-8 encoding work any better??
>
> Cheers,
>
>
> Steve
>
> --
> Steve Holdoway BSc(Hons) MIITP
> http://www.greengecko.co.nz
> Linkedin: http://www.linkedin.com/in/steveholdoway
> Skype: sholdowa
>
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
>
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Wed, Dec 18, 2013 at 9:31 PM, Andrew Taylor <aretaylor@gmail.com> wrote:
> Hi Steve
>
> I gave it a go... but no luck...
> Traceback (most recent call last):
> File "./tv_grab_nz-py", line 227, in <module>
> use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1], channel[0]))
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in
> position 13: ordinal not in range(128)


Top posting not allowed.

Just write your config file by hand if you need to. Format is
plaintext with each line like this:

channel=tv1.freeviewnz.tv

for the channels you want. It's name should be

~USER/.mythtv/FreeviewHD.xmltv

where USER is the user which runs mythbackend.

You can get a list of valid channels by downloading the xmltv file and
searching it

wget http://epg.org.nz/freeview.xml.gz
zgrep "<channel id=" freeview.xml.gz

Clunky but effective.

Author of tv_nz_grab-py - help??



>
> Cheers
>
> A.
>
>
> On 18 December 2013 13:46, Steve Holdoway <steve@greengecko.co.nz> wrote:
>>
>> On Wed, 2013-12-18 at 11:28 +1300, Andrew Taylor wrote:
>> > Hi
>> >
>> >
>> > Apologies if this has been answered before, I had a search through the
>> > archive but couldn't find a working answer.
>> >
>> >
>> > I downloaded the latest tv_grab_nz-py from nice.net.nz and made the
>> > adjustments mentioned by stephen in this thread:
>> > http://www.gossamer-threads.com/lists/mythtv/mythtvnz/559187
>> >
>> >
>> > From:
>> > doc = ElementTree.parse(StringIO(text)).getroot()
>> > ----
>> > To:
>> > parser = ElementTree.XMLParser(encoding="ISO-8859-1")
>> > doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
>> >
>> >
>> >
>> > But it still dies in the configuration for me when it gets to Marori
>> > TV with the unicodeEncodeError .
>> >
>> >
>> > Is there anything else I am missing?
>> > Running Ubuntu 12.04LTS Server (fresh install) with tvheadend and xbmc
>> >
>> >
>> >
>> >
>> > Cheers
>> >
>> >
>> >
>> >
>> > Andrew
>> >
>> I have no idea if this is relevant or not, but ISO-8859-1 usually means
>> the old windows-1252 character set, which probably doesn't support Maori
>> specific characters. Does UTF-8 encoding work any better??
>>
>> Cheers,
>>
>>
>> Steve
>>
>> --
>> Steve Holdoway BSc(Hons) MIITP
>> http://www.greengecko.co.nz
>> Linkedin: http://www.linkedin.com/in/steveholdoway
>> Skype: sholdowa
>>
>>
>> _______________________________________________
>> mythtvnz mailing list
>> mythtvnz@lists.linuxnut.co.nz
>> http://lists.ourshack.com/mailman/listinfo/mythtvnz
>> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
>
>
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
>

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Wed, Dec 18, 2013 at 9:44 PM, Nick Rout <nick.rout@gmail.com> wrote:
> On Wed, Dec 18, 2013 at 9:31 PM, Andrew Taylor <aretaylor@gmail.com> wrote:
>> Hi Steve
>>
>> I gave it a go... but no luck...
>> Traceback (most recent call last):
>> File "./tv_grab_nz-py", line 227, in <module>
>> use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1], channel[0]))
>> UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in
>> position 13: ordinal not in range(128)
>
>
> Top posting not allowed.
>
> Just write your config file by hand if you need to. Format is
> plaintext with each line like this:
>
> channel=tv1.freeviewnz.tv
>
> for the channels you want. It's name should be
>
> ~USER/.mythtv/FreeviewHD.xmltv
>
> where USER is the user which runs mythbackend.

Oh and FreeviewHD is the name of your video source (in mythtv-setup)


>
> You can get a list of valid channels by downloading the xmltv file and
> searching it
>
> wget http://epg.org.nz/freeview.xml.gz
> zgrep "<channel id=" freeview.xml.gz
>
> Clunky but effective.
>
> Author of tv_nz_grab-py - help??
>
>
>
>>
>> Cheers
>>
>> A.
>>
>>
>> On 18 December 2013 13:46, Steve Holdoway <steve@greengecko.co.nz> wrote:
>>>
>>> On Wed, 2013-12-18 at 11:28 +1300, Andrew Taylor wrote:
>>> > Hi
>>> >
>>> >
>>> > Apologies if this has been answered before, I had a search through the
>>> > archive but couldn't find a working answer.
>>> >
>>> >
>>> > I downloaded the latest tv_grab_nz-py from nice.net.nz and made the
>>> > adjustments mentioned by stephen in this thread:
>>> > http://www.gossamer-threads.com/lists/mythtv/mythtvnz/559187
>>> >
>>> >
>>> > From:
>>> > doc = ElementTree.parse(StringIO(text)).getroot()
>>> > ----
>>> > To:
>>> > parser = ElementTree.XMLParser(encoding="ISO-8859-1")
>>> > doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
>>> >
>>> >
>>> >
>>> > But it still dies in the configuration for me when it gets to Marori
>>> > TV with the unicodeEncodeError .
>>> >
>>> >
>>> > Is there anything else I am missing?
>>> > Running Ubuntu 12.04LTS Server (fresh install) with tvheadend and xbmc
>>> >
>>> >
>>> >
>>> >
>>> > Cheers
>>> >
>>> >
>>> >
>>> >
>>> > Andrew
>>> >
>>> I have no idea if this is relevant or not, but ISO-8859-1 usually means
>>> the old windows-1252 character set, which probably doesn't support Maori
>>> specific characters. Does UTF-8 encoding work any better??
>>>
>>> Cheers,
>>>
>>>
>>> Steve
>>>
>>> --
>>> Steve Holdoway BSc(Hons) MIITP
>>> http://www.greengecko.co.nz
>>> Linkedin: http://www.linkedin.com/in/steveholdoway
>>> Skype: sholdowa
>>>
>>>
>>> _______________________________________________
>>> mythtvnz mailing list
>>> mythtvnz@lists.linuxnut.co.nz
>>> http://lists.ourshack.com/mailman/listinfo/mythtvnz
>>> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
>>
>>
>>
>> _______________________________________________
>> mythtvnz mailing list
>> mythtvnz@lists.linuxnut.co.nz
>> http://lists.ourshack.com/mailman/listinfo/mythtvnz
>> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
>>

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On 18/12/13 21:44, Nick Rout wrote:
> Just write your config file by hand if you need to. Format is
> plaintext with each line like this:
>
> channel=tv1.freeviewnz.tv
>
> for the channels you want. It's name should be
>
> ~USER/.mythtv/FreeviewHD.xmltv
>
> where USER is the user which runs mythbackend.
>
> You can get a list of valid channels by downloading the xmltv file and
> searching it
>
> wgethttp://epg.org.nz/freeview.xml.gz
> zgrep "<channel id=" freeview.xml.gz
>
> Clunky but effective.

Correct, good advice, that's what I was going to suggest too.

> Author of tv_nz_grab-py - help??

That's me. tv_nz_grab-py needs fixing, it's on my TODO list.

hads
--
http://nice.net.nz

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Wed, Dec 18, 2013 at 9:53 PM, Hadley Rich <hads@nice.net.nz> wrote:
> On 18/12/13 21:44, Nick Rout wrote:
>>
>> Just write your config file by hand if you need to. Format is
>> plaintext with each line like this:
>>
>> channel=tv1.freeviewnz.tv
>>
>> for the channels you want. It's name should be
>>
>> ~USER/.mythtv/FreeviewHD.xmltv
>>
>> where USER is the user which runs mythbackend.
>>
>> You can get a list of valid channels by downloading the xmltv file and
>> searching it
>>
>> wgethttp://epg.org.nz/freeview.xml.gz
>>
>> zgrep "<channel id=" freeview.xml.gz
>>
>> Clunky but effective.
>
>
> Correct, good advice, that's what I was going to suggest too.
>
>
>> Author of tv_nz_grab-py - help??
>
>
> That's me. tv_nz_grab-py needs fixing, it's on my TODO list.

No pressure, it's a quiet time of year :)

How about a ubuntu package? There have been a few cases recently where
a packaging update might have been handy, like when the
freeview.xml.gz file changed websites. There were certainly a few
users caught out by that.

Then again I'm not really sure how many users it has, there are still
only in the order of 200 users on this mailing list.

I know people use your script for tvheadend too.

Be interesting to know from the owner of epg.org.nz how many hits
he/she gets a day - not that they are all using tv_grab_nz-py to get
the data either.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On 18/12/13 22:01, Nick Rout wrote:
> How about a ubuntu package? There have been a few cases recently where
> a packaging update might have been handy, like when the
> freeview.xml.gz file changed websites. There were certainly a few
> users caught out by that.

Not a bad idea.

> Then again I'm not really sure how many users it has, there are still
> only in the order of 200 users on this mailing list.
>
> I know people use your script for tvheadend too.
>
> Be interesting to know from the owner of epg.org.nz how many hits
> he/she gets a day - not that they are all using tv_grab_nz-py to get
> the data either.

From what I understand it's ~900 hits per day, ~300 unique.

hads
--
http://nice.net.nz

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Wed, Dec 18, 2013 at 9:31 PM, Andrew Taylor <aretaylor at gmail.com>
wrote:
> Hi Steve
>
> I gave it a go... but no luck...
> Traceback (most recent call last):
> File "./tv_grab_nz-py", line 227, in <module>
> use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1],
channel[0]))
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in
> position 13: ordinal not in range(128)

Hi,

I had this problem when I set this up last weekend. The error is caused
by non-ascii characters being written to the terminal. I worked around
it by changing the code to assume 'y' for all channels and then edited
the output file by hand, but that's not very friendly so here's a
better, but not probably not ideal, solution:

Change the line (no 227) in your file that looks like this:

use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1], channel[0]))

to:

use = raw_input('Use channel %s (%s)? [y/N]' %
(channel[1].encode('ascii', 'ignore'), channel[0]))

This will fix the problem by not writing any non ascii characters to the
terminal. This means, from memory, you'll see "Use channel Mori
Television (maori-tv.feeviewtv.nz)? [y/N]" but the correct values will
be written to the file.

Hope it works for you.
Re: tv_grab_nz-py configuration issues [ In reply to ]
Can't one simply replace all data file macron with "a"s and then process
it normally? (Sorry I'm not currently familiar with this language.)

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Fri, Dec 20, 2013 at 8:04 AM, tortise <tortise@paradise.net.nz> wrote:
> Can't one simply replace all data file macron with "a"s and then process it
> normally? (Sorry I'm not currently familiar with this language.)

Then the script configures it downloads the data. The data is
downloaded with the macron in it.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Fri, 20 Dec 2013 09:13:02 +1300, you wrote:

>On Fri, Dec 20, 2013 at 8:04 AM, tortise <tortise@paradise.net.nz> wrote:
>> Can't one simply replace all data file macron with "a"s and then process it
>> normally? (Sorry I'm not currently familiar with this language.)
>
>Then the script configures it downloads the data. The data is
>downloaded with the macron in it.
>

Has anyone tried getting tv_grab_nz-py to run from a terminal that is
running with UTF-8? Like using uxterm, or running unicode_start? In
theory, that should fix this problem.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On 20/12/2013 2:51 PM, Stephen Worthington wrote:
> On Fri, 20 Dec 2013 09:13:02 +1300, you wrote:
>
>> On Fri, Dec 20, 2013 at 8:04 AM, tortise <tortise@paradise.net.nz> wrote:
>>> Can't one simply replace all data file macron with "a"s and then process it
>>> normally? (Sorry I'm not currently familiar with this language.)
>> Then the script configures it downloads the data. The data is
>> downloaded with the macron in it.
>>
> Has anyone tried getting tv_grab_nz-py to run from a terminal that is
> running with UTF-8? Like using uxterm, or running unicode_start? In
> theory, that should fix this problem.

I don't think so. My description of the issue was wrong - I only
bothered learning enough Python to deal with this issue. It seems the
issue is actually in raw_input() and Python2, not the terminal:
http://bugs.python.org/issue7768

As I understand it Python3 should deal with this type of issue more easily.

Anyway, my change works for me, hopefully it works for those having
trouble. It could be improved but I'm not sure it's worth the effort.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
On Wed, Dec 18, 2013 at 9:53 PM, Hadley Rich <hads@nice.net.nz> wrote:
> On 18/12/13 21:44, Nick Rout wrote:
>>
>> Just write your config file by hand if you need to. Format is
>> plaintext with each line like this:
>>
>> channel=tv1.freeviewnz.tv
>>
>> for the channels you want. It's name should be
>>
>> ~USER/.mythtv/FreeviewHD.xmltv
>>
>> where USER is the user which runs mythbackend.
>>
>> You can get a list of valid channels by downloading the xmltv file and
>> searching it
>>
>> wgethttp://epg.org.nz/freeview.xml.gz
>> zgrep "<channel id=" freeview.xml.gz
>>
>> Clunky but effective.
>
>
> Correct, good advice, that's what I was going to suggest too.
>
>> Author of tv_nz_grab-py - help??
>
>
> That's me. tv_nz_grab-py needs fixing, it's on my TODO list.
>
> hads

Old thread sorry.

I wondered hads if you'd had a chance to get this far through your todo list.

I just struck the problem again on setting up tv_grab_nz-py from scratch

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: tv_grab_nz-py configuration issues [ In reply to ]
Hey folks,I noticed an old thread discussing how the initial configuration of tv_grab_nz-py fails due to the macron in Màori Television in freeview xml. I made a minor change to the script to make any channel names (now and in the future) as follows; sorry, didn't put together a patch since it was so simple.
Add the following after the other imports (without the quotes):"from unidecode import unidecode"
On line 226 (or 227 after adding the above), alter the input prompt to replace unicode characters in channel[1] with nice safe ascii (again, without quotes):"use = raw_input('Use channel %s (%s)? [y/N]' % (unidecode(channel[1]), channel[0]))"
Done!Be sure to install unidecode (sudo easy_import unidecode) and the initial configuration works fine; "Màori" is replaced with "Maori" which I'm sure is close enough to prevent confusion...
CheersWayne