Creating a streams script
#1
hi,

i am a webmaster of a radio station's website. i want to make the streams of our radio programmes available via an xbox python script.

is there some kind of framework i can use? or must i create it myself? i am new to python development so i need some basics to start with.

since i am the owner of the website, i can generate like xml content on my webserver to describe the available streams. i already have a itunes rss feed which does something like that.

the files are in the mp3 format.

thanx!
Reply
#2
there is no framework but there is an api and writing scripts for streaming content is pretty easy. probably the best thing for you to do is to find a script that does something similar to what you want and maybe just modify it or use it as a reference. i estimate a minimal streaming python script would be about 25 lines of code and would do the following

1. acquire listing data (xml, rss, parsing html) (10 lines)
2. create a "window" class (has background and controls) (5 lines)
3. get a list of fields from the data and add it to a list control (add the list control to a window) (3 lines)
4. in the windows oncontrol method detect when an item from the listcontrol is selected (3 lines)
5. pass the item's associated url to xbmc.player().play() (1 line)
6. in the window onaction method detect when the back button is pressed and quit the script. (3 lines)

my cnn script on xbmcscripts.com is a good example of grabbing listings from an rss feed and creating a list out of them (though it is complicated by multiple categories and a live description). there are many other scripts though that do this and all aren't too hard to understand. if you have experience in c javascript or php, python should be a breeze for you.
Reply

Logout Mark Read Team Forum Stats Members Help
Creating a streams script0