mirror of
https://github.com/NullHypothesis/censorbib.git
synced 2025-07-23 14:41:07 -04:00
Use the latest Chrome user agent to bypass NDSS's HTTP 403.
This commit is contained in:
parent
dd95fc5ca8
commit
d749b3b314
1 changed files with 2 additions and 1 deletions
|
@ -34,7 +34,8 @@ def download_pdf(url, file_name):
|
|||
print("Now fetching %s" % url)
|
||||
|
||||
try:
|
||||
fetched_file = urllib.request.urlopen(url)
|
||||
req = urllib.request.Request(url, headers={'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36"})
|
||||
fetched_file = urllib.request.urlopen(req)
|
||||
except Exception as err:
|
||||
print(url, err, file=sys.stderr)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue