Skip to content

Commit

Permalink
Merge pull request sundowndev#35 from sundowndev/develop
Browse files Browse the repository at this point in the history
[Fix] Country name for OVH scan
  • Loading branch information
sundowndev authored Feb 19, 2019
2 parents 8bac8eb + e02b4ed commit 719135c
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions phoneinfoga.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

__version__ = 'v1.0.0'
__version__ = 'v1.0.1'

try:
import sys
Expand Down Expand Up @@ -202,20 +202,22 @@ def localScan(InputNumber):
PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace('+', '')
numberCountryCode = phonenumbers.format_number(
PhoneNumberObject, phonenumbers.PhoneNumberFormat.INTERNATIONAL).split(' ')[0]
numberCountry = phonenumbers.region_code_for_country_code(int(numberCountryCode))

localNumber = phonenumbers.format_number(
PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace(numberCountryCode, '')
internationalNumber = phonenumbers.format_number(
PhoneNumberObject, phonenumbers.PhoneNumberFormat.INTERNATIONAL)

country = geocoder.country_name_for_number(PhoneNumberObject, "en")
location = geocoder.description_for_number(PhoneNumberObject, "en")
carrierName = carrier.name_for_number(PhoneNumberObject, 'en')

print(code_result + 'International format: {}'.format(internationalNumber))
print(code_result + 'Local format: 0{}'.format(localNumber))
print(code_result + 'Country found: {} ({})'.format(
geocoder.country_name_for_number(PhoneNumberObject, "en"), numberCountryCode))
print(code_result + 'City/Area: {}'.format(
geocoder.description_for_number(PhoneNumberObject, "en")))
print(code_result +
'Carrier: {}'.format(carrier.name_for_number(PhoneNumberObject, 'en')))
print(code_result + 'Country found: {} ({})'.format(country, numberCountryCode))
print(code_result + 'City/Area: {}'.format(location))
print(code_result + 'Carrier: {}'.format(carrierName))
for timezoneResult in timezone.time_zones_for_number(PhoneNumberObject):
print(code_result + 'Timezone: {}'.format(timezoneResult))

Expand Down Expand Up @@ -544,17 +546,17 @@ def askForExit():


def scanNumber(InputNumber):
print(code_title +
"[!] ---- Fetching informations for {} ---- [!]".format(formatNumber(InputNumber)))

localScan(InputNumber)

global number
global localNumber
global internationalNumber
global numberCountryCode
global numberCountry

print(code_title +
"[!] ---- Fetching informations for {} ---- [!]".format(formatNumber(InputNumber)))

localScan(InputNumber)

if not number:
print((code_error + "Error: number {} is not valid. Skipping.".format(formatNumber(InputNumber))))
sys.exit()
Expand Down

0 comments on commit 719135c

Please sign in to comment.