Skip to content

Commit

Permalink
fix(blender): Fixes blender download
Browse files Browse the repository at this point in the history
  • Loading branch information
cornerfarmer committed Dec 6, 2023
1 parent 07adbe0 commit 4cb8d00
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 List, 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 @@ -137,6 +137,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 4cb8d00

Please sign in to comment.