Commit b28423a5 authored by Ingo Heimbach's avatar Ingo Heimbach

Use a default `User-Agent` when downloading images (`Mozilla/5.0`)

parent e061ffed
...@@ -49,7 +49,7 @@ def load_and_convert_image( ...@@ -49,7 +49,7 @@ def load_and_convert_image(
tmp_dir = None tmp_dir = None
if image_is_remote: if image_is_remote:
image_url = image_filepath_or_url image_url = image_filepath_or_url
response = requests.get(image_url) response = requests.get(image_url, headers={"User-Agent": "Mozilla/5.0"})
response.raise_for_status() response.raise_for_status()
image_content = response.content image_content = response.content
if not convert_to_base64 or image_will_be_converted: if not convert_to_base64 or image_will_be_converted:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment