Posts by stepher

    UPDATE: Did the trick. Thx.

    Appreciate the fast response :)

    I kind of assumed that might be the solution so I did exactly that. Haven't had the chance to check it out (coding/editing computer is upstairs from the PVR system) but will check it later and share/confirm the results.

    I assume that once the lines are deleted, they will not return.

    Thx and cheers....

    I installed the 0.6.0 update of zap2xml. After I fixed a pathing issue (forgot a "/" :( seems to work...for the most part (I like the quotes option for episode title...thx)

    The 1 issue I did notice is that on TV SHows/Guide, I seem to get the same details twice. My program listing info ends with "First Aired" date, HD, etc. and then appears to repeat the details a 2nd time. Don't remember if it's an exact repeat, but close enuf to be redundant output. I checked my tvguide.xml file (where all the listing info is downloaded) and I only see 1 set of details per program listing.

    I also noticed there are 2 settings.xml files. 1 is located under .kodi/addons/script.module.zap2xml/resources/ (this 1 looks more like an sample or template file) and the other is located under .kodi/userdata/addon_data/script.module.zap2xml. That has specific settings. What I noticed in this file is that there is a both a "desc01" and "desc1" (01-09 and 1-9) setting ids (The sample/template file only has the "desc01" (01-09) setting id version. Could this be a source of the double info? If so, what's the best way to resolve this? Is this related to your "delete your user settings for zap2xml and reconfigure them" suggestion?

    Thx for the help and your great work on this.

    Cheers....

    Here's what the .kodi/userdata/addon_data/script.module.zap2xml/settings.xml file looks like:

    <settings>
    <setting id="Pass" value="xxxxxxx" />
    <setting id="User" value="[email protected]" />
    <setting id="allc" value="false" />
    <setting id="cfirst" value="false" />
    <setting id="cicons" value="true" />
    <setting id="days" value="14" />
    <setting id="delay" value="0.000000" />
    <setting id="desc01" value="16" />
    <setting id="desc02" value="8" />
    <setting id="desc03" value="13" />
    <setting id="desc04" value="8" />
    <setting id="desc05" value="18" />
    <setting id="desc06" value="4" />
    <setting id="desc07" value="9" />
    <setting id="desc08" value="8" />
    <setting id="desc09" value="19" />
    <setting id="desc1" value="10" />
    <setting id="desc10" value="3" />
    <setting id="desc11" value="15" />
    <setting id="desc12" value="8" />
    <setting id="desc13" value="11" />
    <setting id="desc14" value="0" />
    <setting id="desc15" value="0" />
    <setting id="desc16" value="0" />
    <setting id="desc17" value="0" />
    <setting id="desc18" value="0" />
    <setting id="desc19" value="0" />
    <setting id="desc2" value="2" />
    <setting id="desc20" value="0" />
    <setting id="desc3" value="7" />
    <setting id="desc4" value="2" />
    <setting id="desc5" value="11" />
    <setting id="desc6" value="15" />
    <setting id="desc7" value="13" />
    <setting id="desc8" value="3" />
    <setting id="desc9" value="9" />
    <setting id="picons" value="true" />
    <setting id="source" value="" />
    <setting id="xdesc" value="false" />
    <setting id="xdetails" value="false" />
    </settings>


    Fixed it (finally), I think!!! But not quite sure why (more familiar with Fedora than with Debian). Here's how I got (back) here:

    1. tvguide.xml not being written to with guide info - I tend to believe this was the heart of the problem....but was thinking it was a path issue. May have been, but not in the way I thought (or understood :( Frustratingly curious by this point, I deleted tvguide.xml and then ran tv_grab_zap2xml. Results were tvguide.xml not found. Never saw this error before so apparently tvguide.xml was being found, but not necessarily the one (or in the way) I believed it was. Created a new tvguide.xml, ran tv_grab_zap2xml again and "File not found" error went away again...still no info written to the file, tho.

    2. Import mechanize error - For this I went back to look (yet, again) at zap2xml.py. When this problem started and I was thinking pathing issue, I changed the kodiPath variable to an absolute reference (/home/osmc/....) and deleted the /storage directory reference because that doesn't exist on my system. Still, running tv_grab_zap2xml produced the "import mechanize" error. Decided it was time to start fresh. I extracted a clean copy of zap2xml.py from the .zip file. Again made the changes to kodiPath. This time, tho, I used Notepad++ set for the python language to edit and save. Restarted tvheadend and watched the HDHomeRun tuner LEDs flash.

    I have Samba enabled on my RPI 3/OSMC so I could check file properties from my Win 10 system. Since I knew tvguide.xml was new and was 0 bytes, I had a reference point. Giving tvheadend a bit of time to do its stuff, I checked properties of tvguide.xml. Lo, and behold, it showed ~2MB and a very recent modified date/time. Went downstairs and checked Live TV/Guide and everything was back (Yayyyy!). I changed days to 14 and checked it again this morning (update set for 3AM) and the program guide had info out to 12/30/16.

    The only thing I can think of is the recent system update glitched something to do with accessing *my* tvguide.xml file. Apparently the guide data was getting written somewhere (no obvious error notices), just not into my file. The "import mechanize" error is on me and just complicated things (I got other odd errors along the way from executing this program). I had been editing the zap2xml.py file with a different editor and that may have introduced some odd control/invisible chars causing problems for Python. Using Notepad++ in Python mode seemed to work just fine.

    When I get the chance I'll go sniff around the Debian/OSMC logs and see if there are any error outputs that might relate to this problem.

    So, thanks for the assistance...at least, until the next time ;)

    I may still try your suggestions. If it really wasn't supposed to work on my system, any recommendations on what I should be using?

    Had some time to kill :( so I decided to go back to the beginning, so to speak, in case one of my files got corrupted somehow :(

    Here's where I've gotten to so far: I uninstalled both zap2xml and mechanize then made sure any "remnant" directories or xml files were deleted from the system. Did a system reboot. Reinstalled zap2xml (and, thus, mechanize). Edited all the references to be consistent with my system. Did another reboot and reset TVH to the zap2xml scraper.

    Once I saved the scraper choice (again) in tvh, it then went off and gathered the data. Still nothing in my tvguide.xml file, but the "import mechanize" error went away...one step closer. What I am now getting in the ~/.kodi/userdata/addon_data/script.module.zap2xml/zap2xml.log file:

    ...snip....
    Getting: gridDetailService?pgmId=EP012252460038
    [D] Parsing: EP012252460038
    Getting: tvschedule.zap2

    These were the last 3 lines in the file (and, yes, the last line is all that was written into the log file). It's like the grabber just stopped mid-process (no errors, tho). I even reduced the no. of days to 1 to minimize the churning time.

    This kind of explains why my tvguide.xml file is empty, but doesn't give me any clue why it just stopped like that.

    In the other zap2xml.log file located in ~/.kodi/addons/script.module.zap2xml were these last 3 lines (all the previous ones were similar but with different pgmId nos.):

    ...snip....
    2016-12-15 17:36:56,107 Getting: gridDetailService?pgmId=SH003304050000
    2016-12-15 17:36:56,239 [D] Parsing: SH003304050000
    2016-12-15 17:36:56,241 Getting: gridDetailService?rtype=pgmimg&pgmId=SH003304050000

    Anything catch your attention?

    Thanks and cheers....

    OK. Still haven't solved the problem. It looks like multiple issues but may turn out to be only one.

    1. I can see tv_grab_zap2xml retrieving data, but it looks like the data is outdated (Nothing past 12/9/16) which is the latest date of any data in my tvguide.xml file so that may be the reason nothing is getting displayed. It's all in the past.
    2. Even tho tv_grab_zap2xml is capturing the info, it is still not updating my tvguide.xml file (modification date has not changed).
    3. "import mechanize" is still casting an error, and this may be the whole enchilada if I can figure out why this is happening.

    As an experiment, in zap2xml.py I trimmed out everything past the "import mechanize" command and ran tv_grab_zap2xml. Needless to say that no data was retrieved, but the same error about "import mechanize" still showed up. I read up on the python import command and realized that the folder "mechanize" becomes a source of include files (module) when a "__init__.py" file is included in the folder. I confirmed that the file does indeed exist.

    Then I tried a simple experiment. I did a basic "cd" to the ......script.module.mechanize/lib/mechanize directory and it went right to it. I know this isn't quite the same as accessing mechanize as a module thru a python program, but I wanted to make sure basic pathing wasn't an issue.

    I checked permissions and ownership and for the files in lib/mechanize all files are osmc:osmc, -rw-r--r--. In script.module.zap2xml the bin folder shows osmc:osmc, drwxr-xr-x, zap2xml.log osmc:video, -rw-rw-rw and teh xzap2xml is osmc:osmc, -rw-r--r--r (which seems consistent for .py files). My tvguide.xml file is osmc:osmc, -rwx-r-xr-x. I'm not completely sure but could this be the update issue? The user and group are not given write permissions. I'll go check this last part out.

    So, does anything I've shared here seem off? While this might seem like a pathing issue, it still may be but not for reasons I may understand. My guess is something is happening (or not) which may not allow the mechanize folder to be seen as a module from zap2xml.py code.

    If I can't get this fixed in the next few days, I'll have to change to something I can get to work (I really liked your addon, tho :(

    Any help or suggestions would be greatly appreciated. Thanks and cheers.....

    Sorry. Should have mentioned that I saw the /storage/.kodi/addons and did change that. Also am running .5.0.

    Keep in mind, it was up and running for a few weeks without any problems. I feel like I've been thru all this before, tho can't remember the specific things I did (which I'm sure included some, or all, of what we've discussed here).

    I'm going back to do some more experimenting and see if some different happens. Otherwise, I'll have to try a new scraper.

    Let me know if you think of anything else. Thanks.

    I'm actually thinking the issue is that kodi path - as you are using OSMC. I'm only familiar with LibreELEC and OpenELEC. You mention that you have a ~/.kodi/addons folder. The addon references the kodi path as /storage/.kodi/addons/

    Perhaps try changing the kodi path to /home/osmc/.kodi/addons/ in the zap2xml.py file??


    [hr]
    Just realized you never answered my question about what file specifically "import mechanize" is trying to load. Or is that not a file, but just a path to a collection of "include" files from the lib/mechanize folder. I went back and looked in the lib/mechanize folder and saw a _mechanize.py file (among a bunch of others). Is that the specific file? If so, then the name is off.

    Also, I don't really remember messing with this part of the zap2xml.py file to get it to work the 1st time.


    Sorry. Should have mentioned that I saw the /storage/.kodi/addons and did change that. Also am running .5.0.

    Keep in mind, it was up and running for a few weeks without any problems. I feel like I've been thru all this before, tho can't remember the specific things I did (which I'm sure included some, or all, of what we've discussed here).

    I'm going back to do some more experimenting and see if some different happens. Otherwise, I'll have to try a new scraper.

    Let me know if you think of anything else. Thanks.

    Appreciate the reply.

    I've reinstalled twice (uninstalled zap2xml, then mechanize) and rebooted, as well. Keep in mind it was working before an OSMC update, so I'm not sure what was broken by the update.

    I looked in ~/.kodi/addons and there is a script.module.mechanize folder. Underneath that is the lib/mechanize path. In mechanize there are a number of .py files. So, at 'import mechanize' is python looking for a specific file titled "mechanize" or does python understand the folder "mechanize" contains the files? Also in zap2xml.py, I changed the line "mechLib = 'script.module.mechanize/lib" to "mechLib = 'script.module.mechanize/lib/mechanize/'" to get directly to the .py routines folder. No help.

    It really feels like a "pathing" issue but I don't know enuf to be sure. Actually, I took a look at the 'import' command and it tells python to look for a module. Not sure if a folder/directory constitutes a module. So, maybe I'm actually missing a piece.

    I'm open to more ideas/suggestions....

    I would suggest you uninstall and reinstall the add on. Looks like mechanize is missing. A reinstall should add that dependency automatically.

    I assume you are running version .5.0?

    [SOLVED] Looks like it's been a while since any postings here....

    1st off, thanks for the great work!! At least, until it stopped working :(

    I'm on OSMC/RPI3/TVH/zap2xml. I finally got it up and running and it was working fine...until a most recent system (OSMC or unbuntu) update (~11/26/16). Now, nothing shows up in the TV Shows/Guide window and my tvguide.xml (changed that from the default) file hasn't been updated since 11/26/16 (I discovered this ~1 week later).

    In the zap2xml.log file I get the following:

    Traceback (most recent call last):
    File "/home/osmc/.kodi/addons/script.module.zap2xml/zap2xml.py", line 92, in <module>
    import mechanize
    ImportError: No module named mechanize

    I changed the path in the 2nd line because there is no "storage" directory on my machine.

    I manually ran tv_grab_zap2xml and it seems to go out and bring a lot of data in. However, my tvguide.xml still does not get updated.

    Any suggestions how to solve this?

    Thanks and cheers.....