Skip to content

Commit 63e6bfb

Browse files
authored
🌟FireFly v2🌟
~ Added a config file. ~ Removed unused modules ~ Neater Code
1 parent 7158237 commit 63e6bfb

File tree

1 file changed

+45
-48
lines changed

1 file changed

+45
-48
lines changed

FireFly.py

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,82 @@
22
import requests
33
import json
44
import time
5-
import urllib
6-
import os
7-
8-
class config:
9-
key = "4a1ede76e87d9e64682b284e8620ad68"
10-
# key = "4395fd642c2f1b24f5d9d01e0a1f838a"
11-
# NOTE: You can get ur own api key there: https://numverify.com/
125

136
def banner():
14-
print ("""
15-
_____ _ _____ _
16-
| ___(_)_ __ ___| ___| |_ _
17-
| |_ | | '__/ _ \ |_ | | | | |
18-
| _| | | | | __/ _| | | |_| |
19-
|_| |_|_| \___|_| |_|\__, |
20-
|___/
7+
print('''
8+
______ _ ______ _
9+
| ____(_) | ____| |
10+
| |__ _ _ __ ___| |__ | |_ _
11+
| __| | | '__/ _ \ __| | | | | |
12+
| | | | | | __/ | | | |_| |
13+
|_| |_|_| \___|_| |_|\__, |
14+
__/ |
15+
|___/
2116
Author: Lexxrt
2217
Github: https://github.com/Lexxrt
23-
""")
18+
''')
2419

2520
def main():
2621
banner()
2722
if len(sys.argv) == 2:
2823
number = sys.argv[1]
29-
api = "http://apilayer.net/api/validate?access_key=" + config.key + "&number=" + number + "&country_code=&format=1"
30-
output = requests.get(api)
31-
content = output.text
32-
obj = json.loads(content)
24+
output = requests.get(f'http://apilayer.net/api/validate?access_key={key}&number={number}&country_code=&format=1').text
25+
obj = json.loads(output)
26+
3327
country_code = obj['country_code']
3428
country_name = obj['country_name']
3529
location = obj['location']
3630
carrier = obj['carrier']
3731
line_type = obj['line_type']
3832

39-
print ("[+] " + "Phone number information gathering")
40-
print ("--------------------------------------")
33+
print('[+] Phone number information gathering')
34+
print('--------------------------------------')
4135
time.sleep(0.2)
4236

43-
if country_code == "":
44-
print (" - Getting Country [ " + "FAILED " + "]")
37+
if country_code == '':
38+
print(' - Getting Country\t\t[ FAILED ]')
4539
else:
46-
print (" - Getting Country [ " + "OK " + "]")
40+
print(' - Getting Country\t\t[ OK ]')
4741

4842
time.sleep(0.2)
49-
if country_name == "":
50-
print (" - Getting Country Name [ " + "FAILED " + "]")
43+
if country_name == '':
44+
print(' - Getting Country Name\t\t[ FAILED ]')
5145
else:
52-
print (" - Getting Country Name [ " + "OK " + "]")
46+
print(' - Getting Country Name\t\t[ OK ]')
5347

5448
time.sleep(0.2)
55-
if location == "":
56-
print (" - Getting Location [ " + "FAILED " + "]")
49+
if location == '':
50+
print(' - Getting Location\t\t[ FAILED ]')
5751
else:
58-
print (" - Getting Location [ " + "OK " + "]")
52+
print(' - Getting Location\t\t[ OK ]')
5953

6054
time.sleep(0.2)
61-
if carrier == "":
62-
print (" - Getting Carrier [ " + "FAILED " + "]")
55+
if carrier == '':
56+
print(' - Getting Carrier\t\t[ FAILED ]')
6357
else:
64-
print (" - Getting Carrier [ " + "OK " + "]")
58+
print(' - Getting Carrier\t\t[ OK ]')
6559

6660
time.sleep(0.2)
6761
if line_type == None:
68-
print (" - Getting Device [ " + "FAILED " + "]")
62+
print(' - Getting Device\t\t[ FAILED ]')
6963
else:
70-
print (" - Getting Device [ " + "OK " + "]")
64+
print(' - Getting Device\t\t[ OK ]')
7165

72-
print ("")
73-
print ("[+] " + "Information Output")
74-
print ("--------------------------------------")
75-
print (" - Phone number: " + str(number))
76-
print (" - Country: " + str(country_code))
77-
print (" - Country Name: " + str(country_name))
78-
print (" - Location: " + str(location))
79-
print (" - Carrier: " + str(carrier))
80-
print (" - Device: " + str(line_type))
66+
print('[+] Information Output')
67+
print('--------------------------------------')
68+
print(' - Phone number:', number)
69+
print(' - Country:', country_code)
70+
print(' - Country Name:', country_name)
71+
print(' - Location:', location)
72+
print(' - Carrier:', carrier)
73+
print(' - Device:', line_type)
8174
else:
82-
print ("[?] Usage:")
83-
print (" ./%s <phone-number>" % (sys.argv[0]))
84-
print (" ./%s +13213707446" % (sys.argv[0]))
75+
print('[?] Usage:')
76+
print('\tFireFly.py <phone-number>')
77+
print(' python3 FireFly.py +13213707446 (Test Number)')
8578

86-
main()
79+
if __name__ == '__main__':
80+
config = open('config.json').read()
81+
data = json.loads(config)
82+
key = data['api_key']
83+
main()

0 commit comments

Comments
 (0)