Help with dev of Live365 script
#1
i am trying to make a live365 script and thought i had it figured out.. but apparently i went wrong somewhere. this is my first attempt at python. i will post the script below.

import clientcookie
import xbmc, xbmcgui
from string import find

# you must fill out this information first
# station number can be found out from saving the pls file from live365 and opening it in a text editor and find the number that comes right after live365.com/play/
membername = ''
passwd = ''
station = ''

loginurl = 'http://www.live365.com/cgi-bin/login.cgi...mbername=' + membername + '&password=' + passwd
request = clientcookie.request(loginurl)
response = clientcookie.urlopen(request)

cj = clientcookie.cookiejar()

cookies = cj.make_cookies(response, request)

saneid = none
sessionid = none
memberid = none

for cookie in cookies:
xbmcgui.dialog().ok("live365", "cookie")
if cookie.has_nonstandard_attr("saneid") and cookie.has_nonstandard_attr("sessionid"):
saneid = cookie.get_nonstandard_attr("saneid")
tempsession = cookie.get_nonstandard_attr("sessionid")
index = find(tempsession, "%3a")
if index > 0:
memberid = tempsession[:index]
sessionid = tempsession[index+3:]
break

if sessionid is not none:
file='http://www.live365.com/play/' + station + '?saneid=' + saneid + '&membername=' + memberid + '&session=' + sessionid
try:
xbmc.player().play(file)
except:
xbmcgui.dialog().ok("live365","unable to play live365 station")
else:
xbmcgui.dialog().ok("live365", "unable to retrieve cookie from live365")

i always get the last error about unable to retrieve cookie. i never can seem to get the message about it recieving a cookie. i have the clientcookie in a subdirectory of my script. i removed my login information but other than that its the same. does anyone see anything obviously wrong with what i am trying to do? i got the idea from here live365 mplayer

since i cant run bash scripts i tried to convert it into python but so far have been unsuccessful. any ideas?



Reply
#2
ok.. well with the help of the emulator i got it working. i didnt quite understand the cookiejar well enough and live365 has some quirks about logging in (you already have to have a cookie present). i will try it at home tonight on the xbox and assuming all goes well i'll be making it available to the public.
Reply
#3
for anyone interested. the script is working very well and i submitted it to xbmcscripts.com so it should show up there once its approved. hopefully others can find it useful.
Reply
#4
xbmc scripts seem to b own for sometime now.........can you help a a brothr out by mailing it or something?
Image
Reply
#5
i just checked xbmcscripts.com and it appears to be up and working. if you still can't get it from there... just pm me your email and i'll send it to you.
Reply
#6
wow! finally live365 on xbmc! hiphoplong.net iz da shit!.........now back to normal..........yea, so it works great but i have a couple questions/issues:

is it supposed to cache for that long? it took like 5-10 mins to cache before it began.

and it causes pm3 to mess up after the station started playing (memory issues?), some of the gfx disappeared.

is there any we can get like the name of the songs to display instead of the station number?
Image
Reply
#7
i'll answer your questions the best i can

1) you can change the cache level in the settings->system area i believe .. you need to change the internet unknown setting or the internet audio... i can't remember which one affects the caching of live365.

2) i haven't noticed any problems like this except on the late march build that caused the gui to hang. but that has been fixed in the april builds. changing your cache setting may affect this too.

3) this i wish i could do ... but live365 doesnt send this data normally it does the same thing when you use winamp or media player to listen to it.... it just shows the song names in a browser. unless you have their player which i believe shows the song names. i suppose it would be possible to constantly get the html and parse out the names but even then i don't know how to change what the player displays.

i hope this helps.



Reply
#8
thanks for answering the questions. i really do appreciate the work thats been put in to creating this script. its quite possibly the only script i use. ive been waiting for this since forever. for the second question u were right. my cache for unknown internet was like 16000+. other than that its great. how about being able to enter the station through the gui? so i can use multiple stations other than one per script.
Image
Reply
#9
well ask and you shall recieve i guess. i looked figured out how to display the song information although it requires you to enter another variable into the script... if you are interested in testing it for me pm me your email.

i am planning on a gui of sorts... but not the browse live365 for the station you want to listen to. the station number is only available in the pls file so you will still have to enter the information into the script. i am planning on allowing you to enter multiple station information into one script and then if you have entered more than one a dialog will pop up and ask you which one you want to listen to.
Reply
#10
i'm having problems with the latest build 4-28. if someone can help me out i would appreciate it... i had someone try my script on the latest build and it wouldn't start a stream from live365. it was working on the 4-21 build. i have made sure my scripts runs under python 2.4 ok which it does.. it appears to be something with mplayer starting the stream.. here's the important part of the log... can anyone tell me whats going on here.

Quote:11:06:29 m: 32423936 info: xcurl::dlllibcurlglobal::easy_aquire - created session to http://www.live365.com
11:06:29 m: 32423936 debug: curl:: debug about to connect() to http://www.live365.com port 80
11:06:29 m: 32423936 debug: curl:: debug trying 216.235.95.145...
11:06:29 m: 32423936 debug: curl:: debug connected
11:06:29 m: 32423936 debug: curl:: debug connected to http://www.live365.com (216.235.95.145) port 80
11:06:29 m: 32423936 debug: curl:: debug head /play/297252?saneid=72.27.112.tbn http/1.1

user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

host: http://www.live365.com

accept: */*
11:06:29 m: 32423936 debug: curl:: debug http/1.1 302 found
11:06:29 m: 32423936 debug: curl:: debug date: fri, 28 apr 2006 15:05:57 gmt
11:06:29 m: 32423936 debug: curl:: debug server: apache
11:06:29 m: 32423936 debug: curl:: debug location: http://216.235.91.30:14914/play
11:06:29 m: 32423936 debug: curl:: debug content-type: text/xml
11:06:29 m: 32423936 debug: curl:: debug connection #0 to host http://www.live365.com left intact
11:06:29 m: 32423936 debug: curl:: debug issue another request to this url: 'http://216.235.91.30:14914/play'
11:06:29 m: 32423936 debug: curl:: debug disables post, goes with head
11:06:29 m: 32423936 debug: curl:: debug about to connect() to 216.235.91.30 port 14914
11:06:29 m: 32423936 debug: curl:: debug trying 216.235.91.30...
11:06:29 m: 32423936 debug: curl:: debug connected
11:06:29 m: 32423936 debug: curl:: debug connected to 216.235.91.30 (216.235.91.30) port 14914
11:06:29 m: 32423936 debug: curl:: debug head /play http/1.1

user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

host: 216.235.91.30:14914

accept: */*
11:06:30 m: 32403456 debug: curl:: debug http/1.0 200 ok
11:06:30 m: 32423936 debug: curl:: debug server: nanocaster/2.6.1-6 29-oct-05
11:06:30 m: 32423936 debug: curl:: debug content-type: audio/mpeg
11:06:30 m: 32423936 debug: curl:: debug cache-control: no-cache
11:06:30 m: 32423936 debug: curl:: debug pragma: no-cache
11:06:30 m: 32423936 debug: curl:: debug connection: close
11:06:30 m: 32423936 debug: curl:: debug content-length: 44000000
11:06:30 m: 32403456 debug: curl:: debug closing connection #1
11:06:30 m: 32403456 debug: filecurl::close(00ab6df0) http://www.live365.com/play/297252?saneid=72.27.112.tbn
11:06:30 m: 32423936 debug: curl:: debug re-using existing connection! (#0) with host http://www.live365.com
11:06:30 m: 32423936 debug: curl:: debug connected to http://www.live365.com (216.235.95.145) port 80
11:06:30 m: 32423936 debug: curl:: debug head /play/297252?saneid=72.27.112.tbn http/1.1

user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

host: http://www.live365.com

accept: */*
11:06:30 m: 32423936 debug: curl:: debug http/1.1 302 found
11:06:30 m: 32423936 debug: curl:: debug date: fri, 28 apr 2006 15:05:58 gmt
11:06:30 m: 32423936 debug: curl:: debug server: apache
11:06:30 m: 32423936 debug: curl:: debug location: http://216.235.91.30:14914/play
11:06:30 m: 32423936 debug: curl:: debug content-type: text/xml
11:06:30 m: 32423936 debug: curl:: debug connection #0 to host http://www.live365.com left intact
11:06:30 m: 32423936 debug: curl:: debug issue another request to this url: 'http://216.235.91.30:14914/play'
11:06:30 m: 32423936 debug: curl:: debug disables post, goes with head
11:06:30 m: 32423936 debug: curl:: debug about to connect() to 216.235.91.30 port 14914
11:06:30 m: 32423936 debug: curl:: debug trying 216.235.91.30...
11:06:30 m: 32423936 debug: curl:: debug connected
11:06:30 m: 32423936 debug: curl:: debug connected to 216.235.91.30 (216.235.91.30) port 14914
11:06:30 m: 32423936 debug: curl:: debug head /play http/1.1

user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

host: 216.235.91.30:14914

accept: */*
11:06:30 m: 32403456 debug: curl:: debug http/1.0 200 ok
11:06:30 m: 32423936 debug: curl:: debug server: nanocaster/2.6.1-6 29-oct-05
11:06:30 m: 32423936 debug: curl:: debug content-type: audio/mpeg
11:06:30 m: 32423936 debug: curl:: debug cache-control: no-cache
11:06:30 m: 32423936 debug: curl:: debug pragma: no-cache
11:06:30 m: 32423936 debug: curl:: debug connection: close
11:06:30 m: 32423936 debug: curl:: debug content-length: 44000000
11:06:30 m: 32423936 debug: curl:: debug closing connection #1
11:06:30 m: 32423936 debug: filecurl::close(00ab6df0) http://www.live365.com/play/297252?saneid=72.27.112.tbn
11:06:30 m: 32321536 debug: filecurl::open(00ab6df0) http://www.live365.com/play/297252?saneid=72.27.112.tbn
11:06:30 m: 32321536 debug: curl:: debug re-using existing connection! (#0) with host http://www.live365.com
11:06:30 m: 32321536 debug: curl:: debug connected to http://www.live365.com (216.235.95.145) port 80
11:06:30 m: 32321536 debug: curl:: debug get /play/297252?saneid=72.27.112.tbn http/1.1

user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

host: http://www.live365.com

accept: */*

accept-encoding: gzip
11:06:31 m: 32321536 debug: curl:: debug http/1.1 302 found
11:06:31 m: 32321536 debug: curl:: debug date: fri, 28 apr 2006 15:05:59 gmt
11:06:31 m: 32321536 debug: curl:: debug server: apache
11:06:31 m: 32321536 debug: curl:: debug location: http://216.235.91.30:14914/play
11:06:31 m: 32321536 debug: curl:: debug content-type: text/xml
11:06:31 m: 32321536 debug: curl:: debug transfer-encoding: chunked
11:06:31 m: 32321536 debug: curl:: debug ignoring the response-body
11:06:31 m: 32321536 debug: curl:: debug connection #0 to host http://www.live365.com left intact
11:06:31 m: 32321536 debug: curl:: debug issue another request to this url: 'http://216.235.91.30:14914/play'
11:06:31 m: 32321536 debug: curl:: debug about to connect() to 216.235.91.30 port 14914
11:06:31 m: 32321536 debug: curl:: debug trying 216.235.91.30...
11:06:31 m: 32321536 debug: curl:: debug connected to 216.235.91.30 (216.235.91.30) port 14914
11:06:31 m: 32321536 debug: curl:: debug get /play http/1.1

user-agent: xbmc/2.0.0 (compatible; msie 6.0; windows nt 5.1; winampmpeg/5.09)

host: 216.235.91.30:14914

accept: */*

accept-encoding: gzip
11:06:31 m: 32321536 debug: curl:: debug http/1.0 200 ok
11:06:31 m: 32321536 debug: curl:: debug server: nanocaster/2.6.1-6 29-oct-05
11:06:31 m: 32321536 debug: curl:: debug content-type: audio/mpeg
11:06:31 m: 32321536 debug: curl:: debug cache-control: no-cache
11:06:31 m: 32321536 debug: curl:: debug pragma: no-cache
11:06:31 m: 32321536 debug: curl:: debug connection: close
11:06:31 m: 32321536 debug: curl:: debug content-length: 44000000
Reply

Logout Mark Read Team Forum Stats Members Help
Help with dev of Live365 script0