From 203d303f7721fcff1a55b938cfb76c64ba71488f Mon Sep 17 00:00:00 2001 From: Staci Cooper Date: Thu, 26 Oct 2023 09:24:41 -0700 Subject: [PATCH] Encode spaces in metropolitan urls --- .../providers/provider_api_scripts/metropolitan_museum.py | 4 ++-- .../sample_additional_image_data.json | 4 ++-- .../resources/metropolitan_museum_of_art/sample_response.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/catalog/dags/providers/provider_api_scripts/metropolitan_museum.py b/catalog/dags/providers/provider_api_scripts/metropolitan_museum.py index 1d6b5152bc2..dd773169b70 100644 --- a/catalog/dags/providers/provider_api_scripts/metropolitan_museum.py +++ b/catalog/dags/providers/provider_api_scripts/metropolitan_museum.py @@ -113,8 +113,8 @@ def get_record_data(self, object_id): return [ { - "foreign_landing_url": foreign_landing_url, - "url": img, + "foreign_landing_url": foreign_landing_url.replace(" ", "%20"), + "url": img.replace(" ", "%20"), "license_info": self.DEFAULT_LICENSE_INFO, "foreign_identifier": self._get_foreign_id(object_id, img), "creator": artist, diff --git a/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_additional_image_data.json b/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_additional_image_data.json index e6697550b17..2a6792cce3b 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_additional_image_data.json +++ b/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_additional_image_data.json @@ -57,9 +57,9 @@ }, { "creator": "Kiyohara Yukinobu", - "foreign_identifier": "45734-DP251120", + "foreign_identifier": "45734-1972", "foreign_landing_url": "https://wwwstg.metmuseum.org/art/collection/search/45734", - "url": "https://images.metmuseum.org/CRDImages/as/original/DP251120.jpg", + "url": "https://images.metmuseum.org/CRDImages/dp/original/1972.173%20RECTO.jpg", "license_info": { "license": "cc0", "url": "https://creativecommons.org/publicdomain/zero/1.0/", diff --git a/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_response.json b/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_response.json index 09915c527e7..a3932b4b38b 100644 --- a/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_response.json +++ b/catalog/tests/dags/providers/provider_api_scripts/resources/metropolitan_museum_of_art/sample_response.json @@ -3,7 +3,7 @@ "accessionYear": "1936", "additionalImages": [ "https://images.metmuseum.org/CRDImages/as/original/DP251138.jpg", - "https://images.metmuseum.org/CRDImages/as/original/DP251120.jpg" + "https://images.metmuseum.org/CRDImages/dp/original/1972.173 RECTO.jpg" ], "artistAlphaSort": "Kiyohara Yukinobu", "artistBeginDate": "1643",