mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-23 05:09:28 +00:00
Handle login expiration
This commit is contained in:
@@ -155,6 +155,11 @@ class GazelleAPI(object):
|
||||
params['auth'] = self.authkey
|
||||
params.update(kwargs)
|
||||
r = self.session.get(url, params=params, allow_redirects=False, timeout=self.default_timeout)
|
||||
|
||||
if r.status_code == 302 and r.raw.headers['location'] == 'login.php':
|
||||
self.logged_in_user = None
|
||||
raise LoginException("User login expired")
|
||||
|
||||
self.past_request_timestamps.append(time.time())
|
||||
return r.content
|
||||
|
||||
|
||||
Reference in New Issue
Block a user