Search Pastebin dumps for query via psbdmp.ws. Returns a descriptive error string on failure rather than raising. Parameters ---------- query: Email address or username to search for. timeout_seconds: HTTP request timeout in seconds. Returns ------
(
query: str,
timeout_seconds: int = _DEFAULT_TIMEOUT,
)
| 67 | |
| 68 | |
| 69 | async def run_paste_osint( |
| 70 | query: str, |
| 71 | timeout_seconds: int = _DEFAULT_TIMEOUT, |
| 72 | ) -> str: |
| 73 | """ |
| 74 | Search Pastebin dumps for query via psbdmp.ws. |
| 75 | |
| 76 | Returns a descriptive error string on failure rather than raising. |
| 77 | |
| 78 | Parameters |
| 79 | ---------- |
| 80 | query: |
| 81 | Email address or username to search for. |
| 82 | timeout_seconds: |
| 83 | HTTP request timeout in seconds. |
| 84 | |
| 85 | Returns |
| 86 | ------- |
| 87 | str |
| 88 | Formatted result string or a descriptive error message. |
| 89 | """ |
| 90 | logger.info("Starting paste search for: %s", query) |
| 91 | try: |
| 92 | pastes = _fetch_paste_data(query, timeout_seconds) |
| 93 | result = _format_paste_results(pastes, query) |
| 94 | logger.info("Paste search complete for: %s", query) |
| 95 | return result |
| 96 | except OSINTError as exc: |
| 97 | logger.warning("Paste search failed: %s", exc) |
| 98 | return f"Scan error: {exc}" |
| 99 | except Exception as exc: |
| 100 | logger.exception("Unexpected error during paste search.") |
| 101 | return f"Internal error: {exc}" |
no test coverage detected