TheOP Guest
|
Posted: Sun Nov 20, 2005 3:40 pm Post subject: Ices 0.4 with Python: Playlist file name is empty |
|
|
I'm running an Ices 0.4 generating an mp3 stream into an external Shoutcast server. The playlist is generated with a special PHP script which selects songs from a library of over 60k mp3 files. I invoke the script through a Python module, which does an HTTP call to the PHP script and always returns a the hardcoded string "/tmp/radiosong.mp3" which is the normalized mp3 file created by the PHP script.
After a few days, Ices always claims it got an empty playlist file name and shuts down, despite the fact that the file name is hardcoded and is never empty.
Here's the function from my ices.py:
Code: |
def ices_get_next ():
global songname
global bandname
while len(songfile) < 1:
print 'Executing get_next() function...'
conn = httplib.HTTPConnection("www.myserver.net")
conn.request("GET", "/radioscript.php")
r1 = conn.getresponse()
songname = r1.getheader("X-Songname","Unknown")
bandname = r1.getheader("X-Artistname","Unknown")
return "/tmp/radiosong.mp3";
|
I'm not a Python expert, so I don't know if there's something in the code that messes things up. Any ideas what could be causing the problems? Thanks in advance!
PS: Ogg streaming is currently not an option so I can't upgrade to 2.0. |
|