Skip to content

Commit

Permalink
Merge pull request #1008 from DLR-RM/iss1006_fix_blender_download
Browse files Browse the repository at this point in the history
fix(blender): Fixes blender download
  • Loading branch information
cornerfarmer authored Dec 6, 2023
2 parents f2e77c0 + bcb5815 commit 1a5d3e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions blenderproc/python/utility/InstallUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from typing import Union, Tuple

if version_info.major == 3:
from urllib.request import urlretrieve
from urllib.request import urlretrieve, build_opener, install_opener
from urllib.error import URLError
else:
from urllib import urlretrieve
from urllib import urlretrieve, build_opener, install_opener
import contextlib

# pylint: disable=wrong-import-position
Expand Down Expand Up @@ -126,6 +126,12 @@ def make_sure_blender_is_installed(custom_blender_path: str, blender_install_pat
url = used_url + ".zip"
else:
raise RuntimeError(f"This system is not supported yet: {platform}")

# setting the default header, else the server does not allow the download
opener = build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
install_opener(opener)

try:
try:
# pylint: disable=import-outside-toplevel
Expand Down

0 comments on commit 1a5d3e6

Please sign in to comment.