mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2024-11-05 13:36:10 +06:00
Update obok.py
Changed MAC address fetching code to address possibile regression
This commit is contained in:
parent
0005bba3c3
commit
14947cd10c
|
@ -471,6 +471,13 @@ class KoboLibrary(object):
|
|||
macaddrs = []
|
||||
if sys.platform.startswith('win'):
|
||||
c = re.compile('\s?(' + '[0-9a-f]{2}[:\-]' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE)
|
||||
try:
|
||||
output = subprocess.Popen('ipconfig /all', shell=True, stdout=subprocess.PIPE, text=True).stdout
|
||||
for line in output:
|
||||
m = c.search(line)
|
||||
if m:
|
||||
macaddrs.append(re.sub("-", ":", m.group(1)).upper())
|
||||
except:
|
||||
output = subprocess.Popen('wmic nic where PhysicalAdapter=True get MACAddress', shell=True, stdout=subprocess.PIPE, text=True).stdout
|
||||
for line in output:
|
||||
m = c.search(line)
|
||||
|
|
Loading…
Reference in New Issue
Block a user