XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-03-20, 01:25   #1
xsintill
Member
 
Join Date: Dec 2003
Posts: 39
xsintill is on a distinguished road
Default

a variation on a script just released by alx5962 is to play a playlist


Quote:
import xbmc

pls = xbmc.playlist(0) * * * * * * * * * * * * * * * * * * * ##0 should be music playlist and 2 should be video playlist... not tested * * *
pls.load("smb://user:password@/idm/test.m3u") * ## load non xbmc playlist into xbmc's playlist *m3u and pls work
xbmc.player().play(pls) * * * * * * * * * * * * * * * * * *## play the playlist
xsintill is offline   Reply With Quote
Old 2004-03-20, 04:04   #2
Vortex
Member
 
Join Date: Feb 2004
Posts: 63
Vortex is on a distinguished road
Default

it works! excellent! thank you for that!

i added a pls.shuffle() before the play line to have nice random songs on boot.

i didn't know if that would work, or if the command existed, but it did lol.
Vortex is offline   Reply With Quote
Old 2004-03-21, 11:15   #3
gameloader
Junior Member
 
Join Date: Mar 2004
Posts: 3
gameloader is on a distinguished road
Default

this is an awsome idea.... can you possibly post a link were i can download the script and how do i use it?
gameloader is offline   Reply With Quote
Old 2004-03-21, 11:43   #4
Nickman
Fan
 
Nickman's Avatar
 
Join Date: Oct 2003
Location: Sweden
Posts: 467
Nickman is on a distinguished road
Default

Quote:
Originally Posted by (gameloader @ mar. 21 2004,09:15)
this is an awsome idea.... can you possibly post a link were i can download the script and how do i use it?
alx5962 python scripts

download copy to your xbmc/scripts folder and in the menu settings/scripts select the script.
__________________
  • Xbox v1.3, 64MB, 120GB HD.
  • ASRock ION 330 Ubuntu XBMC.
  • 40" HDTV 720p, AC3/DTS Receiver.
Read the xbmc online-manual, faq and search the forums before posting.
Nickman is offline   Reply With Quote
Old 2004-03-21, 12:02   #5
xsintill
Member
 
Join Date: Dec 2003
Posts: 39
xsintill is on a distinguished road
Default

or you can create the files yourself.. they are normal textfiles but with a .py extension. they should be put in the scripts directory in xbmc's 'home' directory.

one file should be named autoexec.py
and have the following code in it:
Quote:
import xbmc

xbmc.executescript('q:\\scripts\\autoplay.py')
and the other one should be named autoplay.py
and have the following code in it:
Quote:
import xbmc

pls = xbmc.playlist(0) * * * * * * * * * * * * * * * * * * * ##0 should be music playlist and 2 should be video playlist... not tested * * *
pls.load("smb://user:password@/idm/test.m3u") * ## load non xbmc playlist into xbmc's playlist *m3u and pls work
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
xsintill is offline   Reply With Quote
Old 2004-04-17, 08:54   #6
Zeba
Junior Member
 
Join Date: Mar 2004
Posts: 4
Zeba is on a distinguished road
Default

hi, can someone help me out. i'm new to these python scripts.

i can't get the playlist to play..
i didn't quite understand " ## load non!? xbmc playlist into xbmc's playlist *m3u and pls work "
i made the playlist with xbmc? wrong?

then i edited the script in autoplay.py to:
Quote:
pls.load("f://apps/xbmc/albums/playlists/pl.m3u") *
so is there something wrong with that?

i have a xbmc from 2004-04-13
i have also extracted the python.rar into the /python dir. and i've put the .py files in the /scrpits dir.


thanx!
Zeba is offline   Reply With Quote
Old 2004-04-17, 10:58   #7
xsintill
Member
 
Join Date: Dec 2003
Posts: 39
xsintill is on a distinguished road
Default

zeba you should change it to the following:
Quote:
pls.load("q:\\albums\\playlists\\pl.m3u")
q: stands for the homedirectory of xbmc.
if you have more than 1 xbmc locations on your drive and want to access a playlist created with a different xbmc than where you are executing this script from use the following:
Quote:
pls.load("f:\\apps\\xbmc\\albums\\playlists\\pl.m3 u")
when using filenames locally you should use this slash \ instead of /
because slashes within strings are escape codes you have to put another one behind it
xsintill is offline   Reply With Quote
Old 2004-04-29, 17:21   #8
SpaceFrog
Junior Member
 
Join Date: Nov 2003
Posts: 5
SpaceFrog is on a distinguished road
Default

forkin sweet mayte!!!!

this is what i've wanted for about 3 months!!

i asked around on forums (can't remember if i posted here or not) but didnt get anything helpful at all.

this works pretty damn good, it's for my car mp3 player and, most of the time i can't be stuffed fiddling with the xbox remote to load up a song, i just want to turn on my car and xbox and go.

i'm not sure if i will need to do this but.... does any1 know how to go about making it play a random playlist?

right now i've got mine set to shuffle the big playlist of all my songs on the xbox b4 playing. but it mixes genre's too much i reckon, was thinking of making a few playlists for different genre's
SpaceFrog is offline   Reply With Quote
Old 2004-04-29, 21:00   #9
xsintill
Member
 
Join Date: Dec 2003
Posts: 39
xsintill is on a distinguished road
Default

@spacefrog if i understand you correctly you have a collection of playlists and you want xbmc to pick a random playlist. do the following:


Quote:
import xbmc ,xbmcgui,random

dic={1:"playlist1.m3u",2:"playlist2.pls",3:"playli st3.m3u"}
rnd=random.randint(1,len(dic))
pls = xbmc.playlist(0) * * * * * * * * * * * * * * * * * * *## initialize music playlist 0 should be music where 2 should be video
pls.load(dic[rnd]) * * * * * * * * * * * * * * * * * * * * *## load non xbmc playlist into xbmc's playlist *m3u and pls are tested and work
xbmc.player().play(pls) * * * * * * * * * * * * * * * * * * ## play the playlist
if you want more playlists just add another pair to dic but make sure you don't create gaps so the next new pair should be
Quote:
, 4:"playlistfilename"
and not
Quote:
,5:"playlistfilename"
xsintill is offline   Reply With Quote
Old 2004-05-05, 02:41   #10
NizZ8
Guest
 
Posts: n/a
Default

sweeet!!!! i hear ya on this one spacefrog.. very happy to see this util!. do you have some pix of the setup in your car/truck? i'd be interested to see how your setup looks!
  Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Startup Playlist eggzenbeanz Plugin/Script (Python) Help and Support 1 2006-02-20 12:10
Random Playlist at Startup Omega Xi Plugin/Script (Python) Help and Support 2 2005-10-25 22:37
Random Playlist at Startup Omega Xi XBMC for Xbox Specific Support 1 2005-10-22 03:24
Xbmc automatic copy playlist to q:\albums\playlist gamepc XBMC for Xbox Specific Support 1 2005-06-13 17:11
automatic startup actions xsintill XBMC for Xbox Specific Support 5 2004-03-20 19:51


All times are GMT +2. The time now is 01:23.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project