need help with cookie problem for video plugin - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: need help with cookie problem for video plugin (/showthread.php?tid=49373) |
need help with cookie problem for video plugin - BlueCop - 2009-04-22 I am writing a plugin for wtso.net(Watch The Simpsons Online). i am having a problem with cookies though. script download link pastebin of the script The problem is in the last step of grabbing the video url i am grabbing a episodes html file to for the swf link. example http://cold-link.com/vid/3a464818/.swf it sets a cookie when i retrieve it. example Set-Cookie PHPSESSID=7f21cb75e7d0b036fbb8a52098eeab60; path=/ Expires Thu, 19 Nov 1981 08:52:00 GMT the link actually redirects to example http://player.cold-link.com/player.swf?file=http://cold-link.com/xml/2948ab0486eb756259e2f3ac4e0ee9101176e7db/.xml&autostart=true&fullscreen=true&volume=100&repeat=list&shuffle=false It uses the cookie set before the redirect in its header example Cookie PHPSESSID=7f21cb75e7d0b036fbb8a52098eeab60 i grab the file parameter from this url like below. example http://cold-link.com/xml/2948ab0486eb756259e2f3ac4e0ee9101176e7db/.xml I need to grab this url using the same cookie. The local proxy i use for debugging indicates that the cookie is not getting sent for xml file though. It does however get sent to the redirected url. I suspect my code is faulty but i am not sure. does it have to do with the expiration set in the past? Thanks for any help. - Nuka1195 - 2009-04-22 this is the routine i use. PHP Code: def _install_opener( self ): then i just use the standard urllib2.Request(), request.add_header() and urllib2.urlopen(). you check if cookie exists before you open it, which is good, but you then check it before you save it. which will never save if it doesn't exist. you also don't call install_opener(). - BlueCop - 2009-04-22 i already had the cookie file created. i was trying to copy code from another plug in because i didn't understand how the cookielib worked. the documents on it i have been reading just seem to confuse me. I will try to wrap my head around what you mean and see what i can do. sorry I'm a bit slow =) |