From 0d5ada0f10ead93b73f0cd6739dff1ec06af309c Mon Sep 17 00:00:00 2001 From: mkb79 Date: Sun, 8 Dec 2019 22:39:00 +0100 Subject: [PATCH] some improvements - you don't need to ``register=True`` when instantiate a :class:`audible.auth. FileAuthenticator ` - when you use :class:`audible.auth. LoginAuthenticator` it register as device by default - once a device is registered and credentials are stored, you don't need to use LoginAuthenticator again. If you register you gain a adp_token and device_cert for requesting api. adp_token and device_cert never expires. You need no check about this. Only access token expires after 60 Minutes. But if you use Audible <0.3 you cant use access_token for request. --- audible2sheet/audible2sheet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/audible2sheet/audible2sheet.py b/audible2sheet/audible2sheet.py index 157bfaa..ebeeb6a 100644 --- a/audible2sheet/audible2sheet.py +++ b/audible2sheet/audible2sheet.py @@ -106,8 +106,7 @@ def _restore_from_session_file(self): # Try to restore session from file if possible try: auth = audible.FileAuthenticator( - filename=self._session_file, locale=self._locale, - register=True + filename=self._session_file, locale=self._locale ) self._client = audible.AudibleAPI(auth) except Exception as msg: