| 723 | |
| 724 | |
| 725 | def 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 | |