1 | | - | from bs4 import BeautifulSoup |
2 | | - | import json,requests |
| 1 | + | import requests |
| 2 | + | from verify_email import verify_email |
3 | 3 | | from insides.bcolors import bcolors |
4 | 4 | | |
5 | 5 | | |
6 | | - | def VerifyMail(verifyApi,mail,_verbose=None): |
7 | | - | if _verbose != None: |
8 | | - | |
9 | | - | verifyurl = "https://app.verify-email.org/api/v1/"+verifyApi+"/verify/" |
10 | | - | response1 = requests.get(verifyurl+str(mail)) |
11 | | - | html1 = response1.content |
12 | | - | soup1=BeautifulSoup(html1,"html.parser") |
13 | | - | strsoup1 = str(soup1) |
14 | | - | data1 = json.loads(strsoup1) |
15 | | - | print(f"[{bcolors.HEADER}#{bcolors.ENDC}]" + " Verification result : "+str(data1['status_description'])) |
16 | | - | |
| 6 | + | def VerifyMail(verifyAPIKey, mail, _verbose=None): |
| 7 | + | if _verbose != None: |
| 8 | + | res = requests.get(f"https://app.verify-email.org/api/v1/{verifyAPIKey}/verify/{mail}").json() |
| 9 | + | print(f"[{bcolors.HEADER}#{bcolors.ENDC}] Verify-Email.org result : {res.get('status_description')}") |
| 10 | + | if verify_email(mail): |
| 11 | + | print(f"[{bcolors.HEADER}#{bcolors.ENDC}] Built-in Mail Verify result : {bcolors.OKGREEN}OK{bcolors.ENDC}") |
| 12 | + | else: |
| 13 | + | print(f"[{bcolors.HEADER}#{bcolors.ENDC}] Built-in Mail Verify result : {bcolors.FAIL}FAILED{bcolors.ENDC}") |