Posts by spydah

    It works if I use only the dish network lineup and limit it to a single day. If I add another lineup it crashes. When I get it back up the sd4tvh.log file is empty.

    I ran top as it was running the grabber and what I observed was the python process used 75% of the memory on my RP3 and 99% of the CPU right before it hung. I'm guessing the memory usage is the bigger issue of the two. I suspect the script caches all the JSON data to memory before parsing it to XML. So, even with channel filters it still has to grab the entire lineup data set.

    So, as a test I copied my .kodi directory off to another linux system with 4GB of ram and ran "python sd4tvh.py -u user -p password --filter --filter-path /storage/.kodi/userdata/addon_data/script.module.sd4tvh/filter.cfg" and it worked just fine.

    I've just added some swap space to my libreelec instance and am running it again. It's taking FOREVER. Will update when complete.

    Deleted the other two lineups and removed the filter.cfg as you suggested. Manually running the sd4tvh.py still produces the UnicodeEncodeError when trying to list the channels in a lineup. Full error is below.


    [code=php]
    Traceback (most recent call last):
    File "sd4tvh.py", line 407, in <module>
    main()
    File "sd4tvh.py", line 399, in main
    app.manage()
    File "sd4tvh.py", line 68, in manage
    self._sd.manage()
    File "/storage/.kodi/addons/script.module.sd4tvh/libschedulesdirect/schedulesdirect.py", line 314, in manage
    self._list_lineup_channels()
    File "/storage/.kodi/addons/script.module.sd4tvh/libschedulesdirect/schedulesdirect.py", line 402, in _list_lineup_channels
    print(u"{0}\t{1.callsign} '{1.name}'".format(channel.channel, channel.station))
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 28: ordinal not in range(128)
    [/php]
    [hr]
    Did some more makeshift troubleshooting. The following code removed the error when listing channels, but the pi crashes when I tried to run it to generate the xmltv.xml file. I'm not sure if its a real fix or my pi has something else going on with it.


    [code=php]
    import codecs
    import sys
    UTF8Writer = codecs.getwriter('utf8')
    sys.stdout = UTF8Writer(sys.stdout)
    [/php]


    I got the tip from here


    It's an issue with the ñ character -- likely it's an issue with all non-ascii 128 charcters. I had a similar issue with my zap2xml grabber...now I just have to go back and figure out what I did to make it work!


    I tried entering the code below at the beginning of the schedulesdirect.py file to ensure it was using utf-8, but that didn't help. I just don't know enough about python to troublshoot it.
    [code=php]
    import sys
    reload(sys)
    sys.setdefaultencoding('utf-8')
    [/php]


    There must be a strange character in your lineup name. I probably need to look at how the encoding is done as that shouldn't cause a problem. I haven't worked on the schedules direct addon in awhile - you may want to check out my last version which included the ability to set lineups and channel filters: thread-3715-post-27764.html#pid27764

    If you want to test that version - you can let me know if you have the same error. If your system is working for now - you may not want to be a guinea pig! :)

    WOW, sd4tvh is SO much better!!! But, I'm still running into the encoding issue with it as well. None of my 3 lineups work. I can add them and remove them through the kodi interface, but using the sd4tvh.py and listing the lineups or trying to generate the xmltv.xml file throw the error. Maybe something with my LE version? Happy to move this issue over to a sd4tvh specific thread if that makes sense.

    Lineups:
    1. Claro TV Brasil/Via Embratel - Digital (Brazil)
    2. BSkyB - United Kingdom (United Kingdom)
    3. DISH Network - Satellite (USA)

    Example Error

    [code=php]
    Traceback (most recent call last):
    File "sd4tvh.py", line 407, in <module>
    main()
    File "sd4tvh.py", line 399, in main
    app.manage()
    File "sd4tvh.py", line 68, in manage
    self._sd.manage()
    File "/storage/.kodi/addons/script.module.sd4tvh/libschedulesdirect/schedulesdirect.py", line 310, in manage
    self._list_lineup_channels()
    File "/storage/.kodi/addons/script.module.sd4tvh/libschedulesdirect/schedulesdirect.py", line 398, in _list_lineup_channels
    print(u"{0}\t{1.callsign} '{1.name}'".format(channel.channel, channel.station))
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 28: ordinal not in range(128)
    [/php]

    This thread has been so helpful in getting my LE/TVH/KODI EPG working. I keep running into a problem though when using the sd2xmltv.py script to add a lineup. It frequently crashes out with the following error on some lineups.


    [code=php]
    Traceback (most recent call last):
    File "sd2xmltv.py", line 376, in <module>
    main()
    File "sd2xmltv.py", line 370, in main
    app.manage()
    File "sd2xmltv.py", line 62, in manage
    self._sd.manage()
    File "/storage/.kodi/addons/tools.module.sd2xmltv/libschedulesdirect/schedulesdirect.py", line 306, in manage
    self._add_lineup()
    File "/storage/.kodi/addons/tools.module.sd2xmltv/libschedulesdirect/schedulesdirect.py", line 353, in _add_lineup
    print(u"\t{0}. {1.name} ({2.location})".format(count, lineup, headend))
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 31: ordinal not in range(128)
    [/php]


    It appears that the script doesn't like some of the characters, but I'm not sure where to begin trying to fix this as I know nothing of python. Any thoughts?

    EDIT: In an attempt to get it working I modified the print string to only show the number of the listing. This allowed me to add the listing I wanted. Now when I run the script without the -m option it hangs my Pi. I think the script is having issues elsewhere with the encoding of ascii characters.