Saving Playlists
#1
hi,
i am trying to create a script to save the currently playing playlist to a file on my xbox. i had this working before, but after the last time i updated my xbmc it comes up with an error. here is the code

<script>

if xbmc.player().isplaying():
vplaylist = xbmc.playlist(0)
if vplaylist.size() > 0:
playlistfilehandle = open(lastplaylist, 'w' )
playlistfilehandle.write('#extm3u'+ "\n")

i = 0

while i < vplaylist.size():
playlisttrack = vplaylist[i]
playlistfilehandle.write('#extinf:'+str(playlisttrack.getduration())+','+playlisttrack.getdescription()+"\n")
playlistfilehandle.write(playlisttrack.getfilename()+ "\n")
i = i + 1

playlistfilehandle.flush()
playlistfilehandle.close()

</script>

and the error i get is

playlisttrack = vplaylist[i]

typeerror: unscriptable object

is there a new way to reference the playlistitem? or an easier way to save the playlist to a file automatically? i want a persistent playlist accross reboots.

thanks for any help
Reply
#2
Quote:and the error i get is

playlisttrack = vplaylist[i]

typeerror: unscriptable object

i am seeing the exact same error with a different script called kaleidascrape.py running on june 12th xbmc build.

here is the code snippet where this error is coming up which is same as the above poster.

Quote:plist = xbmc.playlist(2)
#grab queued movie('s) filename(s)#
plistnumber = 0
while plistnumber < plist.size():
queuedmovies.append((plist['plistnumber']).getfilename())
plistnumber = plistnumber + 1

and i am getting the same typeerror: unscriptable object

wondering something changed causing all these scripts retrieving the playlistitem object from playlist to fail?
Reply
#3
i have just installed the "cvs_2006-06-25-t3ch" build and still see the same error while enumerating the playlist object for items in it.

anyone know what is going on?

supernashwan, what happened? did you find out anything about this issue?

thx
sri
Reply
#4
fixed in cvs.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
thanks nuka.

confirm that is is working now in cvs_2006-07-03-t3ch build.

regards
sri
Reply

Logout Mark Read Team Forum Stats Members Help
Saving Playlists0