Skip to content

Commit

Permalink
feat(pacer): Updates sealed document check
Browse files Browse the repository at this point in the history
- Uses a list of sealed document phrases for more efficient and readable checking.
  • Loading branch information
ERosendo committed Oct 30, 2024
1 parent 14c85d0 commit 3035a3e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions juriscraper/pacer/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,16 @@ def download_pdf(
)
if b"You do not have access to this transcript." in r.content:
error = f"Unable to get transcript. {pacer_case_id=}, {url=}"
if b"Sealed Document" in r.content or b"Under Seal" in r.content:

sealed_document_phrases = [b"Sealed Document", b"Under Seal", b"Document is Sealed"]
if any(phrase in r.content for phrase in sealed_document_phrases):
# See: https://ecf.almd.uscourts.gov/doc1/01712589088
# See: https://ecf.cand.uscourts.gov/doc1/035122021132
# See: https://ecf.caed.uscourts.gov/doc1/03319001890
# Matches against:
# "Sealed Document" and
# "Sealed Document"
# "This document is currently Under Seal and not available..."
# "Document is Sealed."
error = f"Document is sealed: {pacer_case_id=} {url=}"
if (
b"This image is not available for viewing by non-court users"
Expand Down

0 comments on commit 3035a3e

Please sign in to comment.