From dfd141fc32cf882e6eab604b5fb249e17096284e Mon Sep 17 00:00:00 2001 From: Oleg Katkov Date: Mon, 13 Jan 2025 18:26:46 +0600 Subject: [PATCH 1/2] Resolves #1268 (https://github.com/freelawproject/juriscraper/issues/1268) --- juriscraper/pacer/hidden_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/juriscraper/pacer/hidden_api.py b/juriscraper/pacer/hidden_api.py index 40a3b20e5..69c9459e6 100644 --- a/juriscraper/pacer/hidden_api.py +++ b/juriscraper/pacer/hidden_api.py @@ -227,8 +227,9 @@ def query(self, pacer_case_id, document_number, attachment_number=""): ) ) logger.info(f"Querying the show_doc_url endpoint with URL: {url}") - # Only do a head request, else we get text content we don't need. - self.response = self.session.head(url, allow_redirects=True) + # we use get request because nysd court disabled all head request + # and bans by IP in case this request is made + self.response = self.session.get(url, allow_redirects=True) self.parse() def _parse_text(self, text): From e6672dc309fec9d1369a19363381c83941ea58ca Mon Sep 17 00:00:00 2001 From: Oleg Katkov Date: Mon, 13 Jan 2025 18:28:40 +0600 Subject: [PATCH 2/2] Fixed typos in comments --- juriscraper/pacer/hidden_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/juriscraper/pacer/hidden_api.py b/juriscraper/pacer/hidden_api.py index 69c9459e6..a2fdc7f48 100644 --- a/juriscraper/pacer/hidden_api.py +++ b/juriscraper/pacer/hidden_api.py @@ -227,8 +227,8 @@ def query(self, pacer_case_id, document_number, attachment_number=""): ) ) logger.info(f"Querying the show_doc_url endpoint with URL: {url}") - # we use get request because nysd court disabled all head request - # and bans by IP in case this request is made + # we use get request because nysd court disabled all head requests + # and bans by IP in case head request is made self.response = self.session.get(url, allow_redirects=True) self.parse()