Allow schema to give images as dict (#859)

This commit is contained in:
cadamswaite 2021-12-05 01:02:35 +00:00 committed by GitHub
parent 8154ee548a
commit 00bc9a15ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,8 @@ def scrape_image(image_url: str, slug: str) -> Path:
all_image_requests = []
for url in image_url:
if isinstance(url, dict):
url = url.get('url', "")
try:
r = requests.get(url, stream=True, headers={"User-Agent": _FIREFOX_UA})
except Exception: