PDA

View Full Version : User-agent spoofing in xbmc.player().play()


scorpion303
2005-08-31, 17:02
when i stream a file through xbmc using the xbmc.player().play("http://38.39.23.24/stream/stream.asx") method.. it always sends 'xbmc-mplayer/1.1.0(mpeg)' as the user-agent to the webserver, and the get-requests looks like this in the webserver-logs:

38.39.23.23 - user1 [30/aug/2005:22:39:21 +0100] "get /streams/stream.asx http/1.0" 200 143088 "-" "[b]xbmc-mplayer/1.1.0(mpeg)[/b]"


is there any possibility to spoof this user-agent, so the webserver sees an windows media player request?

this seems to be possible for normal url-gets (like in the following examle). does anyone know if this works for streams too?


urldata = none
urlheaders = {

'user-agent': 'mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1; .net clr 1.1.4322)',

'accept-language': 'en-us',

}
urllib.urlopen(url,urldata, urlheaders)

pike
2005-08-31, 17:18
that user-agent is sent to "trick" shoutcast servers into letting us connect without issues.

it's defined in mplayer.conf

m3ga
2005-09-01, 10:08
that user-agent is sent to "trick" shoutcast servers into letting us connect without issues.

it's defined in mplayer.conf
he wants to look the dutch big brother streams. the server looks at the user agent. if its not windows media player the stream will be of much lower quality. so he needs to spoof the user agent.