MCPcopy
hub / github.com/iBaa/PlexConnect / MyPlexSignOut

Function MyPlexSignOut

PlexAPI.py:725–741  ·  view source on GitHub ↗
(authtoken)

Source from the content-addressed store, hash-verified

723
724
725def MyPlexSignOut(authtoken):
726 # MyPlex web address
727 MyPlexHost = 'plex.tv'
728 MyPlexSignOutPath = '/api/v2/users/signout'
729 MyPlexURL = 'http://' + MyPlexHost + MyPlexSignOutPath
730
731 # create POST request
732 xargs = { 'X-Plex-Token': authtoken }
733 request = urllib2.Request(MyPlexURL, None, xargs)
734 request.get_method = lambda: 'DELETE' # turn into 'DELETE' - done automatically with data!=None. But we don't have data.
735
736 response = urllib2.urlopen(request).read()
737
738 dprint(__name__, 1, "====== MyPlex sign out XML ======")
739 dprint(__name__, 1, response)
740 dprint(__name__, 1, "====== MyPlex sign out XML finished ======")
741 dprint(__name__, 0, 'MyPlex Sign Out done')
742
743
744

Callers 1

PlexAPI.pyFile · 0.85

Calls 1

dprintFunction · 0.85

Tested by

no test coverage detected