Play a Playlist m3u in Crontab

  • Hi,

    my name in Roberto and I try simply to start a playlist.m3u whith contab but I don't know the name of standard player of Libreelec (no Vlc or other)

    I need to play a playlist every one minute.

    Now I am using Cron XMBC

    */1 * * * * (command to play???) myplaylist.m3u

    Can you help me?

    Thanks

  • Code
    kodi-send --action='PlayMedia("/storage/.kodi/userdata/playlists/music/myplaylist.m3u")'
  • Installing Milhouse Texture Cache Maintenance Utility may assist you in achieving what you wish to perform via crontab.

    In addition to its primary role, utility has a number of very useful options such as:-

    • exec - Execute specified addon, with optional parameters
    • play - Play specified item (local file, playlist, internet stream etc)

    As you query was interesting to me I looked for and found suggestion to use utilty, from this old thread post in Kodi forum.

    (not tried it myself, but sounds like it should work)

  • Roberto

    Libreelec has cron builtin..you don't really need cronxbmc..

    Just tested this and it works fine for what you need..

    Play playlist every minute:

    Code
    * * * * * kodi-send --action='PlayMedia("/storage/.kodi/userdata/playlists/music/yourplaylist.m3u")'
  • Thanks :) work now. Wonderful!!!

    Is there a method to check if playlist is playing to avoid to run again and again my playlist ? (in cronjob of course)

    Sorry for my stupid questions:-/

    Thanks again for your support.

    Edited once, last by Roberto (August 12, 2020 at 7:28 PM).

  • Thanks :) work now. Wonderful!!!

    Is there a method to check if playlist is playing to avoid to run again and again my playlist ? (in cronjob of course)

    Sorry for my stupid questions:-/

    Thanks again for your support.

    maybe try autoexec.py

    Code
    import xbmc
    
    xbmc.executebuiltin( "PlayMedia(/storage/.kodi/userdata/playlists/music/yourplaylist.m3u)" )
    
    xbmc.executebuiltin( "PlayerControl(repeat)" )