From: <lal...@gm...> - 2006-12-20 11:55:23
|
Thibaut Mattern wrote / napísal(a): > Strange, do you mean there is nothing in the HTTP header returned by > the lastfm server that is specific to lastfm ? > Do you have specs ? or a tcp stream capture ? Oh, you are right, it can checks the "Server" header. I wonder why this nice solution didn't occur to me. This makes it even simpler: http://members.chello.sk/lalinsky/xine-lastfm-2.diff >> That's a problem, to handle lastfm:// links you need to create and >> maintain a >> session. The first step is to handshake with the server, providing the >> username >> and password. This returns a stream URL that can be used for playback. >> And then >> you call another scripts to tune-in a radio, or skip/love/ban tracks. >> For all >> these actions you need to provide the session ID returned on the >> handshake. > > Current http plugin is not really designed to do multiple request and > a client session, i think you should create a new plugin for that. > Maybe the simpliest way to handle this protocol is to reuse the > current http plugin from a new lastfm plugin. Current HTTP plugin > handles HTTP 1.0, if you need HTTP 1.1 you will have some more > work.... > >> I thought about implementing it directly in xine-lib too, but I didn't >> know >> xine-lib has a place to store this session data. > > A new plugin. ;-) > Do you need to expose session data if the whole protocol is handled by > the xine-lib plugin ? I'll give this a try during holidays. It would be nice to be able to open lastfm:// directly in xine. Though, I'm still not exactly sure how to do it. I guess the easiest way is making the input_lastfm plugin a wrapper around input_http. input_lastfm will do the handshake, set the correct radio in the session and then redirect to the HTTP stream. I'll just need to refactor some code out of input_http to a simple HTTP client, which can be used in input_lastfm. |