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

Function _collect_source_page_urls

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

Source from the content-addressed store, hash-verified

1572
1573def _collect_source_page_urls(paper: Dict[str, Any]) -> List[str]:
1574 metadata = paper.get("metadata") or {}
1575 source_page_metadata = metadata.get("source_page") or {}
1576 candidates = [
1577 paper.get("paper_url"),
1578 paper.get("url"),
1579 paper.get("doi_url"),
1580 paper.get("openreview_url"),
1581 paper.get("cvf_url"),
1582 paper.get("ecva_url"),
1583 paper.get("dblp_url"),
1584 metadata.get("paper_url"),
1585 metadata.get("url"),
1586 metadata.get("link"),
1587 metadata.get("doi_url"),
1588 metadata.get("openreview_url"),
1589 metadata.get("cvf_url"),
1590 metadata.get("ecva_url"),
1591 metadata.get("dblp_url"),
1592 source_page_metadata.get("source_url"),
1593 ]
1594
1595 urls: List[str] = []
1596 for candidate in candidates:
1597 text = _clean_text(candidate)
1598 if not text.startswith("http://") and not text.startswith("https://"):
1599 continue
1600 if _looks_like_pdf_url(text):
1601 continue
1602 if text not in urls:
1603 urls.append(text)
1604 return urls
1605
1606
1607def _build_pdf_url_candidates_from_source_url(source_url: str) -> List[str]:
1608 normalized = _clean_text(source_url)

Callers 4

_pick_download_refererFunction · 0.85
_extract_pdf_urlFunction · 0.85

Calls 3

_looks_like_pdf_urlFunction · 0.85
getMethod · 0.80
_clean_textFunction · 0.70

Tested by

no test coverage detected