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

Function _get_first_url

agents/reading-agent/main.py:945–955  ·  view source on GitHub ↗
(paper: Dict[str, Any], *keys: str)

Source from the content-addressed store, hash-verified

943
944
945def _get_first_url(paper: Dict[str, Any], *keys: str) -> str:
946 metadata = paper.get("metadata")
947 if not isinstance(metadata, dict):
948 metadata = {}
949
950 for key in keys:
951 for container in (paper, metadata):
952 candidate = _clean_text(container.get(key))
953 if candidate.startswith("http://") or candidate.startswith("https://"):
954 return candidate
955 return ""
956
957
958def _get_direct_pdf_url(paper: Dict[str, Any]) -> str:

Calls 2

getMethod · 0.80
_clean_textFunction · 0.70

Tested by

no test coverage detected