INNER CODE UNIT · Python

texts

zachlagden/Pi-hole-Optimized-Blocklists · .github/triage/triage/__main__.py:70

    texts = [request.raw_domain, request.evidence, request.details, request.body] + [c.body for c in request.thread]
    urls = live.quoted_urls("\n".join(texts), evidence.domain, limit=5)
    evidence.quoted_fetches = [attempt(evidence, f"fetch {url}", lambda u=url: live.fetch_url(u, "desktop"), live.Fetch("desktop", url)) for url in urls]
    live_quoted = next((f.chain[0] for f in evidence.quoted_fetches if f.status and f.status < 400), None)
    if take_screenshot and evidence.addresses:
        evidence.capture = attempt(evidence, "screenshot", lambda: screenshot.capture(evidence.domain, live_quoted), None)
        if evidence.capture and evidence.capture.error:
            evidence.failures.append(f"screenshot: {evidence.capture.error}")


def gather(request: IssueRequest, repo_root: Path, github: GitHub, options: argparse.Namespace) -> Evidence:
    domain = request.domain or ""
    evidence = Evidence(request=request, domain=domain, apex=registrable(domain), platform=shared_platform(domain))
    gather_repo_and_sources(evidence, repo_root)
    gather_reputation(evidence, os.environ.get("VIRUSTOTAL_API_KEY"))
    gather_live(evidence, not options.no_screenshot)
    evidence.reporter = attempt(evidence, "reporter lookup", lambda: github.reporter(request.author, domain), None)
    return evidence

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…