Jump to content


Photo

Autoboot Xbmc Music Playlist At Startup (syntax Error)


  • Please log in to reply
1 reply to this topic

#1 Janglez334

Janglez334

    X-S Enthusiast

  • Members
  • 9 posts

Posted 30 July 2010 - 01:08 AM

Greetings, I've been trying to auto boot my XBMC's music playlist at startup but every Python Script I've tried ends in a syntax error. I've tried several this is my current one i found on a separate forum.


autoexec.py
-------------------
import xbmc
xbmc.executescript('q:\\scripts\\autoplay.py')



autoplay.py
----------------
import xbmc

pls = xbmc.playlist(0) * * * * * * * * * * * * * * * * * * * ##0 should be music playlist and 2 should be video playlist... not tested
try:
* *pls.load("f:\\Applications\\XBMC\\UserData\\playlists\\music\\x.m3u/")
except:
* *pls.load("q:\\UserData\\playlists\\music\\x.m3u") * ## always put twice \ for each dirs

pls.shuffle() * * * * * * * * * * * * * * * * * * * * * * * * * ## delete this line if you don't want random songs to be played from your given playlist
xbmc.player().play(pls) * * * * * * * * * * * * * * * * * *## play the playlist





I've tried everything i could possibly think of, when i run the autoplay.py in XBMC it gives me a "ERROR Script Failed autoplay.py " i check the XBMC.log and it states that there's an invalid syntax.



ERROR: Error Contents: ('invalid syntax', ('Q:\\scripts\\autoplay.py', 3, 26, 'pls = xbmc.playlist(0) * * * * * * * * * * * * * * * * * * * ##0 should be music playlist and 2 should be video playlist... not tested\n'))
19:36:20 M: 40939520 ERROR: File "Q:\scripts\autoplay.py", line 3
pls = xbmc.playlist(0) * * * * * * * * * * * * * * * * * * * ##0 should be music playlist and 2 should be video playlist... not tested



I have the latest XBMC installed and I've tried over 3 separate codes and none of them work and ideas?
Thanks

Edited by Janglez334, 30 July 2010 - 01:10 AM.


#2 cozmo72

cozmo72

    X-S Member

  • Members
  • Pip
  • 94 posts

Posted 18 September 2011 - 11:08 PM

hey buddy, you dont need to install a plugin, just go into skin settings/general, scroll down to play playlist at start up and your sorted. which skin are you using? i use transparency! v2.11 and the music starts up everytime without fail. let me know how you get on




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users