# Autoplay spotify playlist?

**URL:** <https://discourse.mopidy.com/t/autoplay-spotify-playlist/2090>\
**Category:** Pi MusicBox (archive)\
**Created:** [December 6, 2017, 8:11pm UTC](https://discourse.mopidy.com/t/autoplay-spotify-playlist/2090 "2017-12-06T20:11:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itshush](https://avatars.discourse-cdn.com/v4/letter/i/f07891/32.png) [@itshush](https://discourse.mopidy.com/u/itshush)\
**Post date:** [December 6, 2017, 8:11pm UTC](https://discourse.mopidy.com/t/autoplay-spotify-playlist/2090/1 "2017-12-06T20:11:24Z")

</div>

I’m trying to get Musicbox to automatically play a spotify playlist every time the box starts up…

From ssh the following command does the trick:  
mpc load ‘Playlist by SpotifyUser’;mpc play;mpc repeat on;mpc random on

I tried adding the command to rc.local, no luck. Even stuck a sleep in there thinking that may be the issue  
(slep 10;mpc load ‘Playlist by SpotifyUser’;mpc play;mpc repeat on;mpc random on) &

Lastly, i tried the settings.ini and setting the playlist name into the autostart setting, but it cant find the playlist.

Can anyone point out what i am doing wrong?

---

<div class="post-metadata">

**Author:** ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)\
**Post date:** [December 6, 2017, 9:04pm UTC](https://discourse.mopidy.com/t/autoplay-spotify-playlist/2090/2 "2017-12-06T21:04:03Z")

</div>

Look here - it’s an old post but I guess still the same

> [@Can you set a Spotify autoplay URI to randomise song order?](https://discourse.mopidy.com/t/can-you-set-a-spotify-autoplay-uri-to-randomise-song-order/559/2):
>
> The auto play functionality lives at the bottom of [https://github.com/woutervanwijk/Pi-MusicBox/blob/master/filechanges/opt/musicbox/startup.sh](https://github.com/woutervanwijk/Pi-MusicBox/blob/master/filechanges/opt/musicbox/startup.sh) You can add another mpc command at the bottom there to enable random mode. I’d imagine it’s something along the lines of ‘mpc random on’. Might be worth putting it (and maybe also a next command) before the play command so it’s random from the start.

---

<div class="post-metadata">

**Author:** ![jodal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jodal/32/2564_2.png) [@jodal](https://discourse.mopidy.com/u/jodal)\
**Post date:** [February 19, 2026, 11:47am UTC](https://discourse.mopidy.com/t/autoplay-spotify-playlist/2090/3 "2026-02-19T11:47:12Z")

</div>


