Comments (5)
Also running into this issue. However, the suggested regex is bad, as it requires the address to be a dotted atom.
Honestly, in general, the real technical specs of email-local and hostname validation (vs domain name validation vs labels vs .. .. ...) can be quite complex.
If you really want to use a regex, this might work:
valid_mail = "^[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]+)*@[\w-]+[.][\w-]+([.][\w-]+)*$"
# or
text_atom = r"[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]"
valid_mail = fr"^{text_atom}+(\.{text_atom}+)*@[\w-]+[.][\w-]+([.][\w-]+)*$"
That regex is probably going to catch most issues, and probably be lenient enough to permit all valid email addresses.
..but, you could also forego most errors, and this issue coming up again (in all likelihood) and use the email_validator
package.
from email_validator import validate_email, EmailNotValidError
def is_valid_email(obj: str) -> bool:
try:
validate_email(obj, check_deliverability=False) # use True to validate over the net
return True
except EmailNotValidError as error:
print(error) # if you want to describe to the user why it's broken
return False
Yes, it's a third-party module, but it wraps considerable complexity, and it's better to standardize where.. ..well.. ..standards are concerned.
On the complexity of email addresses: http://rumkin.com/software/email/rules.php
On Text Atoms: https://serverfault.com/questions/395766/are-two-periods-allowed-in-the-local-part-of-an-email-address
from audible.
@pengpengker Thank you for opening this issue
@eode Thank you for your code snippet. I'm not really sure what I should do. I could remove the email validation part or I could implement your code and add email_validator
as a dependency.
Edit:
A few opinions from other users would be very helpful now.
from audible.
Also running into this issue. However, the suggested regex is bad, as it requires the address to be a dotted atom.
Honestly, in general, the real technical specs of email-local and hostname validation (vs domain name validation vs labels vs .. .. ...) can be quite complex.
If you really want to use a regex, this might work:
valid_mail = "^[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]+)*@[\w-]+[.][\w-]+([.][\w-]+)*$" # or text_atom = r"[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]" valid_mail = fr"^{text_atom}+(\.{text_atom}+)*@[\w-]+[.][\w-]+([.][\w-]+)*$"That regex is probably going to catch most issues, and probably be lenient enough to permit all valid email addresses.
..but, you could also forego most errors, and this issue coming up again (in all likelihood) and use the package.
email_validator
from email_validator import validate_email, EmailNotValidError def is_valid_email(obj: str) -> bool: try: validate_email(obj, check_deliverability=False) # use True to validate over the net return True except EmailNotValidError as error: print(error) # if you want to describe to the user why it's broken return FalseYes, it's a third-party module, but it wraps considerable complexity, and it's better to standardize where.. ..well.. ..standards are concerned.
On the complexity of email addresses: http://rumkin.com/software/email/rules.php
On Text Atoms: https://serverfault.com/questions/395766/are-two-periods-allowed-in-the-local-part-of-an-email-address
Thank U,it work. Hurray for u
from audible.
I also have this issue.
Many use tags with their gmail addresses, like this:
[email protected]
[email protected]
My Audible username has a tag like this, so I am not able to log in.
from audible.
v0.5.5 solve this issue now
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
- Brazil Account Can not login by external_login HOT 3
- RecursionError introduced in 0.9.0 in some cases HOT 3
- API doc: Only High and Normal is allowed as quality
- `valid_mail` regex is too strict HOT 4
- How does the BestSellers sort_by option in the APIs work? HOT 3
- Where does the file get stored with to_file() HOT 5
- 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.