MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / looks_like_pdf_http_url

Function looks_like_pdf_http_url

agents/master-coordinator/main.py:1068–1085  ·  view source on GitHub ↗

Heuristic filter for direct PDF-style URLs used for reading reports.

(url: Any)

Source from the content-addressed store, hash-verified

1066
1067
1068def looks_like_pdf_http_url(url: Any) -> bool:
1069 """Heuristic filter for direct PDF-style URLs used for reading reports."""
1070 candidate = str(url or "").strip()
1071 if not candidate:
1072 return False
1073 if "://" not in candidate:
1074 candidate = f"https://{candidate.lstrip('/')}"
1075 lowered = candidate.casefold()
1076 return (
1077 lowered.startswith(("http://", "https://"))
1078 and (
1079 ".pdf" in lowered
1080 or "/pdf?" in lowered
1081 or "/pdf/" in lowered
1082 or "arxiv.org/pdf/" in lowered
1083 or "openreview.net/pdf" in lowered
1084 )
1085 )
1086
1087
1088def extract_pdf_url(text: Any) -> Optional[str]:

Callers 2

extract_pdf_urlFunction · 0.85
strip_pdf_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected