Skip to content

Commit

Permalink
Meta: Add User-Agent string on request for download_file
Browse files Browse the repository at this point in the history
  • Loading branch information
EduHCS authored and nico committed Jan 1, 2025
1 parent c74f659 commit e6099be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Meta/download_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e6099be

Please sign in to comment.