Merge pull request #23 from sundowndev/master

Rebase develop
This commit is contained in:
Raphael 2019-01-25 22:36:26 +01:00 committed by GitHub
commit 4fdab3bf34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 13 deletions

View File

@ -308,22 +308,25 @@ def numverifyScan():
apiKey = hashlib.md5((number + requestSecret).encode('utf-8')).hexdigest() apiKey = hashlib.md5((number + requestSecret).encode('utf-8')).hexdigest()
headers = { headers = {
'host': "numverify.com", 'Host': 'numverify.com',
'connection': "keep-alive", 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0',
'content-length': "49", 'Accept': 'application/json, text/javascript, */*; q=0.01',
'accept': "application/json", 'Accept-Language': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3',
'origin': "https://numverify.com", 'Accept-Encoding': 'gzip, deflate, br',
'x-requested-with': "XMLHttpRequest", 'Referer': 'https://numverify.com/',
'user-agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", 'X-Requested-With': 'XMLHttpRequest',
'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", 'DNT': '1',
'referer': "https://numverify.com/", 'Connection': 'keep-alive',
'accept-encoding': "gzip, deflate, br", 'Pragma': 'no-cache',
'accept-language': "en-US,en;q=0.9,fr;q=0.8,la;q=0.7,es;q=0.6,zh-CN;q=0.5,zh;q=0.4", 'Cache-Control': 'no-cache'
'cache-control': "no-cache"
} }
response = requests.request( try:
response = requests.request(
"GET", "https://numverify.com/php_helper_scripts/phone_api.php?secret_key={}&number={}".format(apiKey, number), data="", headers=headers) "GET", "https://numverify.com/php_helper_scripts/phone_api.php?secret_key={}&number={}".format(apiKey, number), data="", headers=headers)
except:
print(code_error + 'Numverify is not available')
return -1
if response.content == "Unauthorized" or response.status_code != 200: if response.content == "Unauthorized" or response.status_code != 200:
print((code_error + "An error occured while calling the API (bad request or wrong api key).")) print((code_error + "An error occured while calling the API (bad request or wrong api key)."))