plugin on linux server : "unknown url type: https"

I’m trying to port the TiVo plugin to Linux.

(It used some OSX specific popen()s.)



opener.open() throws an exception:


The URL is good, although my browser requires a certificate exception.


<br />
  try:<br />
    authhandler = urllib2.HTTPDigestAuthHandler()<br />
    authhandler.add_password("TiVo DVR", "https://" + tivoip + ":443/", "tivo", Prefs.Get("MAC"))<br />
    opener = urllib2.build_opener(authhandler))<br />
    pagehandle = opener.open(url)<br />
  except IOError, e:<br />
    Log.Add("Got a URLError trying to open %s" % url)<br />
    if hasattr(e, 'code'):<br />
      Log.Add("Failed with code : %s" % e.code)<br />
      if (int(e.code) == 401):<br />
        dir.SetMessage("Couldn't authenticate", "Failed to authenticate to tivo.  Is the Media Access Key correct?")<br />
      else:<br />
        dir.SetMessage("Couldn't connect", "Failed to connect to tivo")<br />
    if hasattr(e, 'reason'):<br />
      Log.Add("Failed with reason : %s" % e.reason)<br />
    return dir.ToXML()






I read somewhere to check that python has ssl built in:

>>> import socket
>>> socket.ssl


This worked for both my system python and the python
in /usr/lib/plexmediaserver/Resources/Python/bin .


Any other ideas?
Thanks
tlc

Ah. Another test

fails for

/usr/lib/plexmediaserver/Resources/Python/bin

but not my system python.

I recall there used to be an issue with https on Linux-PMS. I’m pretty sure it was resolved though. Make sure you’re running the latest build of PMS and I would also suggest using the plugin framework’s built-in functions to avoid having import other modules.



XML.ElementFromURL() will handle the http(s) request and return nicely parsed XML. You can also specify auth headers. There’s more info in the docs at Dev.plexapp.com

Apparently, httpS support in linux-PMS is broken again. http://forums.plexapp.com/index.php/topic/40697-the-youtube-channel-login-fails-on-ubuntu-1110/page__view__findpost__p__290985

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.