I’m adding support for live game streaming to the MLB plugin (for mlb.tv subscribers), and it’s definitely testing the plugin framework’s cookie code. The biggest problem I have at the moment is that mlb.com makes heavy use of session cookies, but the framework doesn’t save them.
I poked around in PMS’ HTTP.py, adding an ignore_discard=True param to the __cookieJar.load() and __cookieJar.save() calls, and that seems to do what I need. Session cookies (those with the ‘discard’ flag) are now saved in my plugin’s CookieJar file, and sent back to the server on subsequent HTTP.Get() calls. Yay.
…But that’s only half the problem. HTTP Requests Plex makes to fetch WebVideoItems at the same host still don’t include those session cookies. I suspect there’s another .load() call somewhere deeper inside of Plex that also needs the ignore_discard=True addition.
Can someone confirm my observations and maybe suggest a workaround?
Thanks for the help!
–rick
BTW, framework version 1 showed up on my filesystem at some point. How do I reference it in my init.py? 
Cookies, at the moment, at least, aren't shared between WebKit and the Python code. We played around at one point with letting Python read or write from the shared cookie stash, but it didn't work out quite right.
So what we've been doing in the Site Config is checking for authentication via a state in the Site Config and logging in if needed via javascript via preference data. This will be documented shortly, but check your email for more information.
You are treading on the bleeding edge a bit, but v1 adds full support for preferences, and the Site Config has access to those preferences (e.g. name, password). (You can even do it in v0, see Hulu for an example, but it's a bit of a hack).
You just need to request the new version in your plug-in's Info.plist like this:
<key>PlexFrameworkVersion</key><br />
<string>1</string>
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.