Comments (5)
You can extend the Authenticator
class this way:
from audible import Authenticator
class ExtendedAuthenticator(Authenticator):
@classmethod
def from_dict(cls, data: dict):
auth = cls()
auth.locale = data.pop("locale_code", None)
if "login_cookies" in data:
auth.website_cookies = data.pop("login_cookies")
auth._update_attrs(**data)
return auth
def to_dict(self):
data = {
"website_cookies": self.website_cookies,
"adp_token": self.adp_token,
"access_token": self.access_token,
"refresh_token": self.refresh_token,
"device_private_key": self.device_private_key,
"store_authentication_cookie": self.store_authentication_cookie,
"device_info": self.device_info,
"customer_info": self.customer_info,
"expires": self.expires,
"locale_code": self.locale.country_code,
"activation_bytes": self.activation_bytes
}
return data
Now you have the possibility to export the data as a dict and create a new instance from ExtendedAuthenticator
from dict! You can now store the data in a way you like!
from audible.
Hi. The to_file
and from_file
classmethods take a pathlib.Path
or string instance to present the file.
You can add a custom class method to override this behave. If you tell me, what you want to do, I can help you more.
from audible.
Ah right.
Because my instance hosting the library is ephemeral, when it gets scaled the files on the drive are removed and replaced. So I was thinking of storing the file either as blob in DB, blob storage, or in a secure S3 bucket.
from audible.
Oh wow thanks for your help. This is great!!
from audible.
I‘ve implement this function in audible now. You can test it now with pip install -i https://test.pypi.org/simple/ audible==0.7.1.dev1
from audible.
Related Issues (20)
- 错误提示 HOT 19
- Quality is set to `Extreme` even set to `high` HOT 1
- TEST: New device registration method HOT 4
- Extract Audible Bookmark Notes HOT 3
- Issue getting activation bytes from auth server HOT 9
- Switch to poetry, implement CI+CD, remove Python version <3.8
- Lift upper version restriction on `httpx`. HOT 3
- Is there any way to get a list of books in a series? HOT 1
- Amazon authentication code not handled properly HOT 2
- I need some help with metadata HOT 2
- Audible brazil HOT 11
- Captcha Login Fails 'KeyError' HOT 17
- OTP prompt for 2FA in JupyterLab HOT 4
- Building an external login URL HOT 9
- encryptedPwd HOT 5
- How does the BestSellers sort_by option in the APIs work? HOT 3
- Can't filter plus catalog books from 'catalog/products' HOT 9
- state token for library requests HOT 2
- response_callback no longer works properly with the endpoint: https://cde-ta-g7g.amazon.com/FionaCDEServiceEngine/sidecar HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audible.