Audible
Audible copied to clipboard
`valid_mail` regex is too strict
(Noticed while debugging GGyll/audible-bookmark-extractor#16)
Describe the bug I cannot authenticate. I always get the CVF prompt, but nothing happens. When enabling the log, I get a message that my email address is not valid. However, it is. ;-)
Since this is just a warning, I am not sure if this solves my problem, but the regex seems to be wrong: valid_mail = r"^[a-z0-9]+[\._-]?[a-z0-9]+[@]\w+[.]\w+$"
does check for TLS but does not allow subdomains on the right of the @
.
To Reproduce
- Try to authenticate using
audible.Authenticator.from_login
with email and password
2024-03-18 14:03:55,519 WARNING [audible.login] login.py:349: Username [email protected] is not a valid mail address
Expected behavior Successful login, or received CFV code via email, or something like that.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Debian
- Browser: Firefox
- Version: 124
Additional context
Quick test using the latest regex:
>>> import re
>>>
>>> def is_valid_email(obj: str) -> bool:
... valid_mail = r"^[a-z0-9]+[\._-]?[a-z0-9]+[@]\w+[.]\w+$"
... if re.match(valid_mail, obj):
... return True
... return False
...
>>> is_valid_email('[email protected]')
True
>>> is_valid_email('[email protected]')
False
The email validation will give only a warning and will not result in an abort. So your issue with the authentication must be something other.
Do you have 2FA enabled? If not, this can cause the problem. It seams, Amazon has changed the the html response. So my package can not determine the correct page status. You can try to login using Authenticator.from_login_external
. Maybe the response from Amazon in your browser will give you more information.
Thanks for the reply! You are right, I don't have MFA enabled at the moment. I'll try your suggestion!
This issue has not been updated for a while and will be closed soon.
This issue has automatically been closed due to no activities.