Meta: Add User-Agent string on request for download_file

This commit is contained in:
Eduardo HCS 2024-12-31 17:02:14 -04:00 committed by Nico Weber
parent c74f659ebd
commit e6099bea77

View file

@ -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: