diff --git a/catalog/common/downloaders.py b/catalog/common/downloaders.py index 2baf4e3f..69288186 100644 --- a/catalog/common/downloaders.py +++ b/catalog/common/downloaders.py @@ -231,8 +231,10 @@ class ImageDownloaderMixin: return RESPONSE_NETWORK_ERROR @classmethod - def download_image(cls, image_url, page_url): + def download_image(cls, image_url, page_url, headers=None): imgdl = cls(image_url, page_url) + if headers is not None: + imgdl.headers = headers try: image = imgdl.download().content image_extention = imgdl.extention diff --git a/catalog/sites/google_books.py b/catalog/sites/google_books.py index b4e34f6a..f922a37c 100644 --- a/catalog/sites/google_books.py +++ b/catalog/sites/google_books.py @@ -56,8 +56,15 @@ class GoogleBooks(AbstractSite): brief = re.sub(r"<.*?>", "", brief.replace("