GrooveShark in XBMC (Relay server)
#1
Hi,

I'm trying to extend the usability of the GrooveShark script by integrating it more in XBMC's playback functions. The problem with grooveshark is that you have to translate a song id to a streaming URL. This is done through interaction with a JSON server which returns the streaming URL. You can't just take a bunch of song id's, query the JSON server for all the streaming URL's and put them in the PlayList class because the streaming URL's expire rather quickly.
So in an effort to solve this I decided to write a small http server (or relay server) that would act as a streaming server that xbmc.Player() would query, the relay server does the JSON stuff, and simply redirects xbmc.Player() to the correct streaming URL. To make it work the relay server needs to run in its own thread so I implemented it as a python thread using basehttpserver as the server. I tried starting it from a separate script inside XBMC and inside the grooveshark script itself both with the same outcome; when xbmc.Player() is called it queries the relay server thread but the server doesn't respond until xbmc.Player() times out. I think I understand the cause, XBMC being single threaded in nature, but I hadn't expected the player to lock up the python engine.
I can get around the problem by running the relay server outside XBMC but I would like to keep it in XBMC so the script can work across platforms. So long story short:

Is there some way to start a thread in XBMC that isn't blocked by xbmc.Player() or some trick that can be used to avoid the above?

Cheers,
Solver
Reply

Logout Mark Read Team Forum Stats Members Help
GrooveShark in XBMC (Relay server)0