Kodi AutoPlay & Repeat Playlist At Startup

Making Kodi autoplay a playlist when loaded, then repeat that playlist until stopped is not as straight forward as you might think, with some trial and error reading the issues various people encountered, this is how i ended up successfully making Kodi play and repeat my video play list when started / loaded up.

Firstly go to  Settings > Appearance > Skin

Ensure you are using the Confluence skin and select “Settings”:

Kodi Auto Repeat Playlist On Startup

Then under the General setting “Enable playlist at startup” and select where the playlist is saved as the path:

Kodi Auto Repeat Playlist On Startup

That’s the obvious part done, however if you do that and leave Kodi to it, you will find when you reach the end of the play list Kodi will not repeat it.

To have Kodi repeat this play list we need to place a little script in the Kodi userdata folder, the location of this will vary depending on the operating system you are using, see the table below for help:

Operative system File path
Android Android/data/org.xbmc.kodi/files/.kodi/userdata/
iOS /private/var/mobile/Library/Preferences/Kodi/userdata/
Linux ~/.kodi/userdata/
Mac /Users/<your_user_name>/Library/Application Support/Kodi/userdata/
LibreELEC/OpenELEC /storage/.kodi/userdata/
Windows Start – type %APPDATA%\kodi\userdata – press <Enter>


Once you are in the Kodi userdata folder you want to create a file called autoexec.py, you can do this in any text editor. For example Notepad on Windows or Nano on Linux based operating systems.

Simply paste the following in your autoexec.py file and save it:

import xbmc
xbmc.executebuiltin( “PlayerControl(repeat)” )

Kodi Auto Repeat Playlist On Startup

If for some reason you are having trouble here is a zipped copy of my autoexec.py you can simply unzip to your Kodi userdata folder.

The end result should be when Kodi boots your playlist will start playing and the autoexec.py script will ensure the play list repeats in-defiantly.

I have done the above on a Raspberry Pi 3 running Kodi via OpenELEC 6.0.3 with no issue, my videos happily repeat all day long in our showroom.

Final Note:

It’s worth mentioning you can also make Kodi start playing a playlist with the autoexec.py script:

import xbmc
xbmc.executebuiltin( “PlayMedia(/storage/.kodi/userdata/playlists/video/showroom.m3u)” )
xbmc.executebuiltin( “PlayerControl(repeat)” )

However i found if the TV was not on when Kodi was loaded  it would only play the first item on the playlist, then keep repeating the first item on the playlist only. This for me was not ideal as i needed everything to just work with no user interaction, which is what the solution detailed in this blog post allows for.

I hope this is of help to someone anyway!

Matt Hill

Matt Hill is in his mid 20′s and has a passion for technology. Matt studied Computer and Network Administration at University and currently works as an IT Administrator for a company based in his home town.


  1. Ron   •  

    Ey Matt, Thanks for this, that’s awesome! I was hoping you also have a solution for my next little problem: How could I remotely change the files in that playlist (over the internet). By FTP, perhaps? Can you point me in the right direction? Thanks! Ron

    • Matt Hill   •     Author

      That’s really going to depend on the OS you are running Kodi on, if its Open ELEC or Linux you should have SSH access by default, so can just connect via SFTP and download the playlist, modify it in Notepad for example, then re-upload the playlist and any new media to the location you specified on the playlist.

      After doing so you could reboot and Kodi should startup and be playing the new playlist.

  2. xury   •  

    Hi Matt
    It’s what I needed.
    But maybe you know how to do playing only 30 second for every item on playlist ?
    Then next and next in loop forever 🙂

    • Matt Hill   •     Author

      I can’t think how you would do that in Kodi. You might well need to write a custom plugin to do something like that.

      You might have more luck asking on the Kodi forums, how come you only want to play 30 seconds out of curiosity?

  3. runner2004   •  

    I set up my osmc for with the partymode(music) command. Works very well in cooperation with updating the library on startup. As I added the ‘music’folder of my USB flash to the library, I just need to copy the desired files to the flash drive and plug it to the pi, actually installed in my car.

Leave a Reply