2006-06-24, 05:06
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
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