mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
Meta: Add User-Agent string on request for download_file
This commit is contained in:
parent
c74f659ebd
commit
e6099bea77
1 changed files with 4 additions and 1 deletions
|
@ -74,7 +74,10 @@ def main():
|
|||
|
||||
os.makedirs(output_file.parent, exist_ok=True)
|
||||
|
||||
request = urllib.request.Request(args.url, headers={"Accept-Encoding": "gzip"})
|
||||
request = urllib.request.Request(args.url, headers={
|
||||
"Accept-Encoding": "gzip",
|
||||
"User-Agent": "Serenity Meta/download_file.py",
|
||||
})
|
||||
with urllib.request.urlopen(request) as f:
|
||||
try:
|
||||
with tempfile.NamedTemporaryFile(delete=False, dir=output_file.parent) as out:
|
||||
|
|
Loading…
Reference in a new issue