WebGrab+Plus

  • awiouy  primaeval, think I have finally understood how-to set up timer service for webgrabplus.start

    On my Rpi2 running LibreELEC, I have created service.webgrabplus.service and service.webgrabplus.timer files and transferred them to

    \Storage\.config\system.d

    service.webgrabplus.service

    Code
    [Unit]
    Description=WebGrab+Plus
    Documentation=http://www.webgrabplus.com/
    After=network.target
    Requires=network.target
    
    
    [Service]
    Type=simple
    ExecStart=/bin/sh /storage/.kodi/addons/service.webgrabplus/bin/webgrabplus.start

    service.webgrabplus.timer

    Then I enabled and started timer with following commands via ssh

    systemctl enable service.webgrabplus.timer
    systemctl start service.webgrabplus.timer

    I can check that the webgrabplus timer and service are actively running via ssh (following is short extract of pertinent info)

    systemctl list-timers

    Code
    NEXT                         LEFT          LAST                         PASSED
    UNIT                         ACTIVATES
    Mon 2016-10-10 04:00:00 BST  9h left       n/a                          n/a
    service.webgrabplus.timer    service.webgrabplus.service

    Now see if service runs successfully/correctly at 04:00 tomorrow morning :rolleyes:

    Edited once, last by MikeKL (October 16, 2016 at 2:05 PM).

  • Hello all,

    I have added a system.d timer to the addon.

    By default, the webgrabplus.run shell script will run:
    - 300 seconds after the service is started, and
    - daily at 03:00

    These settings can be changed via the addon settings (add-ons/my add-ons/service/WebGrab+Plus/settings):

    --on-active:
    Specifies a delay in seconds.
    If left blank, webgrabplus.run will not be run when the service is started.

    --on-calendar:
    Specifies a calendar event (see here for the syntax).

    Preview versions:
    - for LE 7
    - for LE 8

    Thank you for testing

  • Excellent. Thanks.

  • OK Installed LE 8 Preview version of LibreELEC WebGrab+Plus service (over top of my existing WebGrab+Plus service Installation)

    I then ensured latest version of WebGrab+Plus service was configured/enabled and to my preferences.

    Add-ons -> Add-on Browser and select My Add-ons

    Select Services

    Select WebGrab+Plus

    Select Configure

    WebGrab+Plus Settings options

    • I have removed default 300 value from --on-active field (To stop run of webgrabplus 300s (5Mins) after every device restart)
    • I have left --on-calendar field at default setting. (To run webgrabplus daily at 03:00)


    Everything looking Good :cool: thank you very much for modifiable timer addition to LibreELEC WebGrab+Plus Service add-on Awiouy :cool:

    Edited once, last by MikeKL (October 23, 2016 at 12:29 PM).

  • sshing to rpi2 and running the "systemctl list-timers" command, following is the interesting information, extracted from commands output

    Code
    NEXT                         LEFT     LAST                         PASSED       UNIT                         ACTIVATES
    
    
    Mon 2016-10-24 03:00:00 BST  11h left Sun 2016-10-23 11:21:33 BST  4h 22min ago webgrabplus.timer            webgrabplus.service
    • NEXT = Next time the job will run
    • LEFT = Time remaining until next job runs (from current time)
    • LAST = Last time job ran (from current time, which was 300 secs after webgrabplus service was installed/enabled)
    • PASSED = Time since last job ran
    • UNIT = the webgrabplus.timer
    • ACTIVATES = the webgrabplus.service


    Which gives me a good indication that webgrabplus will run fine at 03:00 on Monday morning ;)

  • Indeed MikeKL,

    There are now three system.d units:
    - service.webgrabplus.service (aka service.webgrabplus)
    - webgrabplus.timer
    - webgrabplus.service (aka webgrabplus).

    service.webgrabplus triggers webgrabplus.timer, which in turn starts webgrabplus.

    These units may be queried with systemctl status unit and journalctl -u unit.

    To see a log of webgraplus.run, use journalctl -u webgraplus.

  • I can't get to a LibreELEC device right now. The kids have taken over the TV.
    I can't see where the settings get from settings.xml to webgrabplus.start in those zip files.

  • Thank you very much for the addon! My old XMLTV service stopped working on Saturday and it only took me an hour with this addon to have s future proof replacement! It works like a charm on libreelec 8 preview alpha 7... Thank you very much!


  • Thank you MikeKL for the feedback and for the detailed instructions.
    I will ask to commit the corresponding pull request


    Quick update to confirm job ran successfully as expected on my rpi2 at 03:00 this morning and have just used Kodi GUI and webgrabplus settings option to modify time to run job on Tue morning at 04:00

    Checking remotely using ssh and "systemctl list-timers" command, confirms next job will run Tue 2016-10-25 04:00:00 BST ;)

    Edited once, last by MikeKL (October 24, 2016 at 8:17 PM).

  • This addon is working fine! My LE box (Nexbox A95X) fetches the XML correctly, but TVHeadend is running on my Synology NAS so I would like to be able to use it there.
    Of course I could copy the XML to my NAS, and send it to the xmltv.sock (using curl command). But is there a way to send the XML from LE to the xmltv.sock on my NAS?

    Edited once, last by chielmi (October 29, 2016 at 9:22 AM).

  • Sure, that makes sense! Going to try this :)

    Edit: took me some time, total scripting n00b here :angel: . Couldn't get it to work from LE, but I managed to create a working solution.
    Mounted the addon directory of LE in my NAS. NAS sends the XML from the mount to the socket 6 times per day, using a simple script (based on HOWTO: Three ways to use xmltv.sock :(

    Bash
    #!/bin/bash 
    curl='/usr/bin/curl'
    curl -d @/volume1/Media/xmltv/xmltv.xml -X POST -m 5 --unix-socket /volume1/@appstore/tvheadend-testing/var/epggrab/xmltv.sock http://google.com

    Edited once, last by chielmi (October 30, 2016 at 9:03 AM).