mirror of
https://github.com/fastogt/pyfastogt
synced 2025-02-12 12:51:53 +00:00
Change email validation
This commit is contained in:
parent
4e4a544e00
commit
77b7fab955
2 changed files with 6 additions and 5 deletions
|
@ -10,7 +10,7 @@ import tarfile
|
|||
from urllib.request import urlopen
|
||||
|
||||
import certifi
|
||||
from validate_email import validate_email
|
||||
from email_validator import validate_email, EmailNotValidError
|
||||
|
||||
|
||||
class CommonError(Exception):
|
||||
|
@ -21,9 +21,10 @@ class CommonError(Exception):
|
|||
return self.value_
|
||||
|
||||
|
||||
def is_valid_email(email: str, check_mx: bool) -> bool:
|
||||
dns_valid = validate_email(email, check_mx=check_mx)
|
||||
if not dns_valid:
|
||||
def is_valid_email(email: str) -> bool:
|
||||
try:
|
||||
validate_email(email)
|
||||
except EmailNotValidError as e:
|
||||
return False
|
||||
|
||||
validate_url = 'https://open.kickbox.com/v1/disposable/' + email
|
||||
|
|
2
setup.py
2
setup.py
|
@ -23,7 +23,7 @@ VERSION = '1.0.0'
|
|||
|
||||
# What packages are required for this module to be executed?
|
||||
REQUIRED = [
|
||||
'validate_email',
|
||||
'email-validator',
|
||||
'distro',
|
||||
'certifi',
|
||||
'requests'
|
||||
|
|
Loading…
Reference in a new issue