rename to outOut, handle http 204

This commit is contained in:
Hellowlol 2017-10-11 23:31:05 +02:00
parent a4443db64f
commit e48462cd9f

View file

@ -145,7 +145,7 @@ class MyPlexAccount(PlexObject):
allheaders = BASE_HEADERS.copy()
allheaders.update(headers or {})
response = method(url, headers=allheaders, timeout=timeout, **kwargs)
if response.status_code not in (200, 201):
if response.status_code not in (200, 201, 204):
codename = codes.get(response.status_code)[0]
errtext = response.text.replace('\n', ' ')
log.warn('BadRequest (%s) %s %s; %s' % (response.status_code, codename, response.url, errtext))
@ -361,7 +361,7 @@ class MyPlexAccount(PlexObject):
self._webhooks = self.listAttrs(data, 'url', etag='webhook')
return self._webhooks
def opt(self, playback=None, library=None):
def optOut(self, playback=None, library=None):
"""Opt in or out of sharing stuff with plex. See
https://www.plex.tv/about/privacy-legal/
@ -375,7 +375,7 @@ class MyPlexAccount(PlexObject):
url = 'https://plex.tv/api/v2/user/privacy'
return self.query(url, method=self._session.put, **dict(params=params))
return self.query(url, method=self._session.put, params=params)
class MyPlexUser(PlexObject):