32 lines
565 B
Python
32 lines
565 B
Python
#!/usr/bin/env python3
|
|
|
|
import re
|
|
import requests
|
|
|
|
data = str()
|
|
|
|
# We download the data from IEEE
|
|
oui = requests.get("https://standards-oui.ieee.org/oui/oui.txt")
|
|
if oui.status_code != 200:
|
|
exit(1)
|
|
|
|
# Convert to list
|
|
l = list()
|
|
line = str()
|
|
for c in oui.text:
|
|
line += c
|
|
if c == "\n":
|
|
l.append(line)
|
|
line = str()
|
|
|
|
# Remove the "header" on the file
|
|
d = l[4:]
|
|
|
|
# We get all OUI
|
|
regex = "[a-zA-Z0-9]{6}"
|
|
compiled = re.compile(regex)
|
|
for entry in d:
|
|
s_entry = entry.split(" ")
|
|
if compiled.match(s_entry[0]):
|
|
print(s_entry[0])
|