Detect invalid token with myplex (#1138)

This commit is contained in:
jjlawren 2023-05-24 14:04:32 -05:00 committed by GitHub
parent 4946b4bc8b
commit 581a167180
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,6 +188,8 @@ class MyPlexAccount(PlexObject):
raise Unauthorized(message)
elif response.status_code == 404:
raise NotFound(message)
elif response.status_code == 422 and "Invalid token" in response.text:
raise Unauthorized(message)
else:
raise BadRequest(message)
if headers.get('Accept') == 'application/json':