()
| 12627 | return [{"username": email, "type": "Holehe", "info": {"Status": f" Holehe non disponibile: {e}"}, "main_img": "https://cdn-icons-png.flaticon.com/512/732/732200.png", "status_code": 500, "url": ""}] |
| 12628 | |
| 12629 | async def _run(): |
| 12630 | out = [] |
| 12631 | checked = 0 |
| 12632 | failed = 0 |
| 12633 | timed_out = 0 |
| 12634 | started = time.monotonic() |
| 12635 | async with httpx.AsyncClient( |
| 12636 | timeout=httpx.Timeout(max(5, module_timeout + 2)), |
| 12637 | follow_redirects=True, |
| 12638 | headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"} |
| 12639 | ) as client: |
| 12640 | for m in pkgutil.walk_packages(holehe.modules.__path__, holehe.modules.__name__ + "."): |
| 12641 | if time.monotonic() - started > total_timeout: |
| 12642 | break |
| 12643 | modname = m.name |
| 12644 | basename = modname.split(".")[-1] |
| 12645 | try: |
| 12646 | mod = importlib.import_module(modname) |
| 12647 | except Exception: |
| 12648 | continue |
| 12649 | |
| 12650 | fn = getattr(mod, basename, None) |
| 12651 | if fn and inspect.iscoroutinefunction(fn): |
| 12652 | try: |
| 12653 | before = len(out) |
| 12654 | with trio.move_on_after(module_timeout) as scope: |
| 12655 | await fn(email, client, out) |
| 12656 | checked += 1 |
| 12657 | if scope.cancelled_caught and len(out) == before: |
| 12658 | timed_out += 1 |
| 12659 | except Exception: |
| 12660 | failed += 1 |
| 12661 | continue |
| 12662 | return out, checked, failed, timed_out, round(time.monotonic() - started, 2) |
| 12663 | |
| 12664 | try: |
| 12665 | raw, checked, failed, timed_out, elapsed = trio.run(_run) |
nothing calls this directly
no outgoing calls
no test coverage detected