I did not find a way to pass cookies and other HTTP headers to XBMC for video playback, so I wrote a small python script that can be installed as an XBMC service. It works a bit like a proxy server (remember VeohProxy?) and allows you to specify:
- the URL to download and
- the HTTP headers to send with each request XBMC makes to that URL
It will just pass through the request headers that XBMC sends to the local webserver and add the ones you specified. It will then send back all the data it receives from the real server.
The script might be useful for streaming directly from one-click-hosting services like Rapidshare, FileServe and others. These services typically use an HTML form or some kind of HTTP API to validate the user's credentials and sets a cookie with a session key - without this cookie, there is no way to download the file.
It provides a webserver on 127.0.0.1:64653. To make a request, first encode the URL you want to retrieve in Base64 and do the same with the HTTP headers to be sent. The HTTP headers need to be in the format a web server would expect:
if the video URL is
You can check in your addon if the service is running by querying
Here's the script:
I wrote this only for testing purposes, but figured it might help other people to create better streaming plugins.