Skip to content

Commit

Permalink
Merge pull request #20 from ComputeAllTheThings/master
Browse files Browse the repository at this point in the history
Changed the update requests to replace the standard Python user-agent…
  • Loading branch information
tristanlatr authored Jun 5, 2020
2 parents dfb1374 + 905734f commit 00d1480
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manuf/manuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
import io

try:
from urllib2 import Request
from urllib2 import urlopen
from urllib2 import URLError
except ImportError:
from urllib.request import Request
from urllib.request import urlopen
from urllib.error import URLError

Expand Down Expand Up @@ -139,7 +141,7 @@ def update(self, manuf_url=None, wfa_url=None, manuf_name=None, refresh=True):

# Retrieve the new database
try:
response = urlopen(manuf_url)
response = urlopen(Request(manuf_url, headers={'User-Agent': 'Mozilla'}))
except URLError:
raise URLError("Failed downloading OUI database")

Expand All @@ -159,7 +161,7 @@ def update(self, manuf_url=None, wfa_url=None, manuf_name=None, refresh=True):

# Append WFA to new database
try:
response = urlopen(wfa_url)
response = urlopen(Request(wfa_url, headers={'User-Agent': 'Mozilla'}))
except URLError:
raise URLError("Failed downloading WFA database")

Expand Down

0 comments on commit 00d1480

Please sign in to comment.