WebGrab+Plus

  • I assume you forgot to type /storage in the crontab? Or, does that work?


    I have finally forced cron to work on my RPi by running "systemctl start cron" evidently that forced cron to sync it's clock to the system clock.
    [hr]
    If I add a before.sh or after.sh, are you guys are talking Linux and assuming we all know to add
    #!/bin/sh
    at the top of the script and the chmod 755 script.name?

    Or, that is not needed?

    I also gather those scripts go into /storage/.kodi/userdata/addon_data/service.webgrabplus ?


    Neither shbang, nor chmod are needed. The service expects before.sh and after.sh to be in the addon home folder.

  • I assume you forgot to type /storage in the crontab? Or, does that work?

    Yes your right forgot :dodgy: to add /storage double-checked and line in my root file is 0 3 * * * /storage/.kodi/addons/service.webgrabplus/bin/webgrabplus.start
    Sorry about that.. :blush:

    Edited once, last by MikeKL (October 1, 2016 at 9:08 PM).

  • I'm used to figuring out typos in linux like situations. Remember the "type your own program" magazines? I had a COCO3 with OS9 (something like UNIX) you had to type your own, then figure out who had the fat fingers.

    Typing was easier than downloading a file at 300 baud onto a cassette tape and then debugging it. Helloworld.sh could take an hour.

    And figuring out which path to a file in a modified OS to use is a pain, how are you supposed to know which sym link to use for which program?

  • Hello Gabriel!

    No, it is a shell script, that you define and that runs after webgrabplus/time_correct/wg2pm


    Thank you for your quick reply,

    I saw the config with the "after.sh" at the end, have the after.sh in the folder. The after.sh is doing the job started on its own. It has 777 attrib. Still not running... or at least I don't see the result.
    The log is only telling me that that the job finished succesfully. Is there another log to see what exactly is happening with after.sh.

    Thank you,
    Gabriel


  • Thank you for your quick reply,

    I saw the config with the "after.sh" at the end, have the after.sh in the folder. The after.sh is doing the job started on its own. It has 777 attrib. Still not running... or at least I don't see the result.
    The log is only telling me that that the job finished succesfully. Is there another log to see what exactly is happening with after.sh.

    Thank you,
    Gabriel

    We could help you, if we knew your script ;)

  • We could help you, if we knew your script ;)

    #!/usr/bin/python


    f = open('/storage/guide_wgp.xml','r')
    filedata = f.read()
    f.close()

    newdata1 = filedata.replace('"ITV"','"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"')
    newdata2 = newdata1.replace('programme','YYYYYYYYYYYYYYYYYYYY')

    f = open('/storage/guide_copy.xml','w')
    f.write(newdata2)
    f.close()


  • after.sh is a shell script, not a python script :D
    Copy that script to after.py, and call it from after.sh with python after.py ;)

  • awiouy I've had a go at adding a configurable system.d Timer to the service but have got stuck. Please help.

    I can't work out how LibreELEC is triggering the system.d services. I tried to start the timer in the default.py file but it doesn't work.
    On reboot it runs the .service file even though it should start the .timer file.

    I added a user setting for the system.d timer's OnCalendar field to make it as flexible as possible and a random delay to be nice to the servers.

    The code so far is here:
    GitHub - primaeval/service.webgrabplus


  • awiouy I've had a go at adding a configurable system.d Timer to the service but have got stuck. Please help.

    I can't work out how LibreELEC is triggering the system.d services. I tried to start the timer in the default.py file but it doesn't work.
    On reboot it runs the .service file even though it should start the .timer file.

    I added a user setting for the system.d timer's OnCalendar field to make it as flexible as possible and a random delay to be nice to the servers.

    The code so far is here:
    GitHub - primaeval/service.webgrabplus


    Hi primaeval!

    LE automatically:
    a) enables/starts service.webgrabplus.service at system startup
    b) runs default.py at Kodi startup

    Modify one or the other to enable your timer. In any case, the service called by the timer should not be named service.webgrabplus.service.

    To enable a service/timer:
    systemctl enable path-to-the-service-unit/service-unit

    I hope this will help you. Keep me posted.

  • Hi primaeval!

    LE automatically:
    a) enables/starts service.webgrabplus.service at system startup
    b) runs default.py at Kodi startup

    Modify one or the other to enable your timer. In any case, the service called by the timer should not be named service.webgrabplus.service.

    To enable a service/timer:
    systemctl enable path-to-the-service-unit/service-unit

    I hope this will help you. Keep me posted.


    Thanks.

    As far as I can see the .timer has to start a service called the same name .service in the same folder.
    If I can't call it .service because it gets started automatically by LE, do you know what I should call it?
    systemd.timer

    I can see why people get frustrated by system.d now. ;)


  • Thanks.

    As far as I can see the .timer has to start a service called the same name .service in the same folder.
    If I can't call it .service because it gets started automatically by LE, do you know what I should call it?
    systemd.timer

    I can see why people get frustrated by system.d now. ;)


    Call the service/timer anything you like, eg webgrabplus.service/timer, as long as it is not service.webgrabplus.service.

    Try it manually first ;)

  • Call the service/timer anything you like, eg webgrabplus.service/timer, as long as it is not service.webgrabplus.service.

    Try it manually first ;)

    I'm actually trying to modify your addon so that it can be flexible. This isn't my addon.
    When the time that it is running webgrab corresponds to a time I am using a TV Guide, it stops the TV Guide loading.
    I'm trying to make it configurable so webgrab can run in the middle of the night when nobody is awake and using the box.

  • Are you referring to guide.xml or another guide_*.xml file?
    guide.xml is only updated once, by a cp at the end of processing, which should be quite short.

    You are right: I'm accessing the intermediate guide xml file. I'll set up the correct one.
    It still seems to be too much for my crappy little amlogic mxq box with things going on in the background though.
    I would feel a lot happier with the processing happening at night, just once a day.