How to pass cookies to addDirectory
#1
Question 
Hi guys... been stuck on this for hours and I thought it might be time to ask for some help. I read in this thread that we can use:

Code:
http://path/to/movie/file.mov|COOKIE=<urlencodedCookie>


to instruct XBMC to pass the required cookie onto the server to play the file. I just can't seem to get this to work. I've fetched the cookie without any trouble at all.

Cookies.lwp

Code:
#LWP-Cookies-2.0
Set-Cookie3: akanocache=1; path="/"; domain=".gametrailers.com"; path_spec; domain_dot; expires="2011-09-25 07:49:35Z"; version=0
Set-Cookie3: gtsid_vgs=1315936976843887642291965706; path="/"; domain=".gametrailers.com"; path_spec; domain_dot; expires="2011-09-14 04:00:00Z"; version=0
Set-Cookie3: mosesuser="MYUSERACCOUNT%3Ad2f4c6b9a2a57586cfe886cb2e6d1cb0"; path="/"; domain=".gametrailers.com"; path_spec; domain_dot; expires="2012-03-11 18:02:56Z"; version=0
Set-Cookie3: ak-mobile-detected=no; path="/"; domain="www.gametrailers.com"; path_spec; expires="2011-09-14 00:02:56Z"; version=0

XBMC Log
Code:
14:51:40 T:9904 M:4294967295   ERROR: CDVDDemuxFFmpeg::Open - error probing input format, http://www.gametrailers.com/download/712954/t_mortalkombatretro_pt1_gt_dn6g_hd.mov|COOKIE=%23LWP-Cookies-2.0%0ASet-Cookie3%3A%20akanocache%3D1%3B%20path%3D%22/%22%3B%20domain%3D%22.gametrailers.com%22%3B%20path_spec%3B%20domain_dot%3B%20expires%3D%222011-09-25%2007%3A42%3A52Z%22%3B%20version%3D0%0ASet-Cookie3%3A%20gtsid_vgs%3D1315936573382908446269100093%3B%20path%3D%22/%22%3B%20domain%3D%22.gametrailers.com%22%3B%20path_spec%3B%20domain_dot%3B%20expires%3D%222011-09-14%2004%3A00%3A00Z%22%3B%20version%3D0%0ASet-Cookie3%3A%20mosesuser%3D%22MYUSERACCOUNT%253Ad2f4c6b9a2a57586cfe886cb2e6d1cb0%22%3B%20path%3D%22/%22%3B%20domain%3D%22.gametrailers.com%22%3B%20path_spec%3B%20domain_dot%3B%20expires%3D%222012-03-11%2017%3A56%3A13Z%22%3B%20version%3D0%0ASet-Cookie3%3A%20ak-mobile-detected%3Dno%3B%20path%3D%22/%22%3B%20domain%3D%22www.gametrailers.com%22%3B%20path_spec%3B%20expires%3D%222011-09-13%2023%3A56%3A13Z%22%3B%20version%3D0%0A

Am I suppossed to encode the entire cookie file or just a certain part of it? Anyways, I'm starting to see double so I'm gonna break for a while and hopefully someone here can tell me what I'm screwing up

Thanks!
Reply
#2
Ok, I figured it out...

The correct syntax seems to be:
Code:
def addLink(name,url,iconimage):
    if (COOKIE_EXIST()) == True:
        url=url + '|Cookie=Cookie: gtsid_vgs=1315946027153678509816214928; mosesuser=AUTH_USER%3Ad2f4c6b9a2a57586cfe886cb2e6d1cb0'
          
    ok = True
    liz = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
    liz.setInfo( type="Video", infoLabels={ "Title": name } )
    ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
    return ok

Holy cow that took my feeble mind far too long to work out.

Anyways... hope this helps someone else hopelessly searching for a way to send an auth cookie to a server when the user clicks an item in the XBMC dir list.

Cheers!
Reply
#3
thank you soooo much..helps my headache Smile
Reply

Logout Mark Read Team Forum Stats Members Help
How to pass cookies to addDirectory0