[Fix #15] Add exception on tempophone API call

This commit is contained in:
Raphael 2018-12-29 18:58:40 +01:00 committed by GitHub
parent 6cce114a7a
commit bcf11a938b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

View File

@ -482,14 +482,17 @@ def osintScan():
if tmpNumAsk.lower() != 'n' and tmpNumAsk.lower() != 'no':
print((code_info + '---- Temporary number providers footprints ----'))
print((code_info + "Searching for phone number on tempophone.com..."))
response = requests.request("GET", "https://tempophone.com/api/v1/phones")
data = json.loads(response.content)
for voip_number in data['objects']:
if voip_number['phone'] == formatNumber(number):
print((code_result + "Found a temporary number provider: tempophone.com"))
askForExit()
try:
print((code_info + "Searching for phone number on tempophone.com..."))
response = requests.request("GET", "https://tempophone.com/api/v1/phones")
data = json.loads(response.content)
for voip_number in data['objects']:
if voip_number['phone'] == formatNumber(number):
print((code_result + "Found a temporary number provider: tempophone.com"))
askForExit()
except:
print((code_error + "Unable to reach tempophone.com API. Skipping."))
osintDisposableNumScan()