[Release] Service to pass cookies/HTTP headers to XBMC video player
#16
BINGO!!!

Persistance pays off.....

It's a bit of a hack, but I can stream an m3u8 file without problem. The problem I had again was try/except statements hiding problems. Much as I like them, they don't half cause some bother.....

I doubt this will support ffwd/rwd though.... Smile
Reply
#17
hippojay Wrote:BINGO!!!

Persistance pays off.....

It's a bit of a hack, but I can stream an m3u8 file without problem. The problem I had again was try/except statements hiding problems. Much as I like them, they don't half cause some bother.....

I doubt this will support ffwd/rwd though.... Smile

Which solution do you use? Your server or the URL with header passed to xbmc player?
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#18
Temhil Wrote:Which solution do you use? Your server or the URL with header passed to xbmc player?

Might be talking about two different things here, I knida hijacked the thread to talk about using this proxy server to parse and concatenate m3u8 playlists files.

If you want to pass headers to a server via XBMC, just append "|header=headervalue" to the url:

url="http://localhost/some/file.avi|X-Forwarded-For=some+other+host"

EDIT: btw, in my script I pass all the headers through httplib that I can, but if using an XBMC call (setResolvedUrl, player().play(), etc) then I pass using the | pipe..
Reply
#19
Ok, thanks for the update.
Another question about the proxy server, do you have a way to stop it properly?
I did similar implementation, but it was pain in the neck to stop the proxy server, and not crashing XBMC.
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#20
Temhil Wrote:Ok, thanks for the update.
Another question about the proxy server, do you have a way to stop it properly?
I did similar implementation, but it was pain in the neck to stop the proxy server, and not crashing XBMC.



Laugh Nope!! Tried all sorts and nothing brings it down. no idea why, as i've even set the "while (True)" to "while (RUN)" and set RUN to False!! It's mad....

If you want to check out the car crash, here it is:

https://github.com/hippojay/plugin.video...LSproxy.py
Reply
#21
Worked out what the problem was. As this is a multi-threaded server, when you attempt to stop the proxy by using a URL/stop or some other signal via a URL - you are stopping that child thread, not the parent.

So you need to signal to the parent to stop. I just use a file check.
Code:
file="terminate.proxy"
        while(RUN):
            try:
                exists = open(file, 'r')
                break
            except: pass
            httpd.handle_request()

EDIT: Just tested and definately works in XBMC.

To make this a complete solution:
* I pass the filename to use as a script argument (to cater for *nix and windows)
* The stop method will create the file based on the name
* The while loop will attempt to read the file, then close it and then delete it
* the main function will delete the message file if located on startup (the assumption is that only one proxy is started at any one time)

There is a small delay of a few seconds until it stop, but it definately does..
Reply
#22
Unbehagen Wrote:Hey, please see this post first: http://forum.xbmc.org/showthread.php?tid=77500 - the functionality of manipulating headers seems to be implemented natively in XBMC. Just use the pipe character after the url and set the headers using key=value touples.

I tried to access a video hosted on Rapidshare like this:

http:// rapidshare .com/files/4243022changed/mad.men.s04e12.hdtv.xvid-fever .avi|Cookie: enc=84uH38dh904383903u882d8492374027389H23038s46238023CHANGED

I have Rapidshare Premium and i used the data of the cookie i get when i log into my account. I selected the direct download option in my account.
Can you tell me what i did wrong?
Reply
#23
rufus99 Wrote:I tried to access a video hosted on Rapidshare like this:

http:// rapidshare .com/files/4243022changed/mad.men.s04e12.hdtv.xvid-fever .avi|Cookie: enc=84uH38dh904383903u882d8492374027389H23038s46238023CHANGED

I have Rapidshare Premium and i used the data of the cookie i get when i log into my account. I selected the direct download option in my account.
Can you tell me what i did wrong?

I haven't done this in a while, but a debug log/Wireshark capture file might reveal the problem. Can you supply those?
Reply
#24
Shouldn't you use URL|Cookies=something instead of Cookies:something? If I remember correctly, you probably have to urlencode the value to not have problems with the second = character.
Reply
#25
thank you. you're right:

URL|Cookie=URLENCODEDCOOKIE

is working
Reply
#26
The urlResolver script module supports Rapidshare and about 40 others. Feed it a link and it gives you back a playable video url
Reply

Logout Mark Read Team Forum Stats Members Help
[Release] Service to pass cookies/HTTP headers to XBMC video player0