Skip to content

fix(onion_checker): handle Ahmia verification token, drop dead DarkSearch, annotate module_status (#535) - #536

Merged
NovaCode37 merged 1 commit into
NovaCode37:mainfrom
Fire162:fix/onion-checker-ahmia-token-pre-ci
Oct 10, 2026
Merged

NovaCode37 merged 1 commit into
NovaCode37:mainfrom
Fire162:fix/onion-checker-ahmia-token-pre-ci

Conversation

@Fire162

@Fire162 Fire162 commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Closes #535

Summary

modules/onion_checker.py previously failed to return results due to two issues:

  1. Ahmia verification token: Ahmia requires a dynamic rotating hidden input token from the home page. Requests to /search/?q=... without this token received a 302 redirect back to /, causing empty search results.
  2. DarkSearch: darksearch.io is permanently unreachable and always resulted in network failures.
  3. Both failures were silently swallowed, returning an empty OK result rather than reporting failures.

Changes

  1. Ahmia Token Handling:
    • In _search_ahmia (modules/onion_checker.py), first perform a GET https://ahmia.fi/ using a single requests.Session to extract the rotating hidden input token name and value.
    • Include the extracted token pair as query parameters in the subsequent search request (https://ahmia.fi/search/?q=...&<token_name>=<token_val>).
  2. Remove DarkSearch:
    • Removed _search_darksearch and cleaned references to DarkSearch in the source code, UI cards (frontend/src/components/views/ScanResults.tsx), TypeScript definitions (frontend/src/lib/types.ts), and documentation (README.md, docs/ARCHITECTURE.md).
  3. Module Status Annotation:
    • Annotated module results using annotate(..., OK) on success and annotate(..., ERROR, reason) when target is empty or Ahmia lookup fails (missing token, non-200 HTTP response, or request exception).
  4. Tests:
    • Updated tests/test_v2_1_modules.py with tests verifying:
      • Extraction of rotating hidden token and successful Ahmia search.
      • Accurate aggregation and filtering of Ahmia results.
      • Reporting status: error upon network failure.
    • All tests pass.

@Fire162
Fire162 requested a review from NovaCode37 as a code owner October 10, 2026 07:23
@github-actions github-actions Bot added documentation Improvements or additions to documentation python Pull requests that update python code javascript Pull requests that update javascript code labels Oct 10, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the first pull request here. CI needs a maintainer to approve the run before it starts, so it may sit for a bit before anything happens. pytest tests/ -q passing is the main thing I look at.

@NovaCode37 NovaCode37 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked it live: a search for "bitcoin" returns 25 results again, and the tests pass. Thanks.

@NovaCode37 NovaCode37 added the hacktoberfest-accepted Counts toward Hacktoberfest label Oct 10, 2026
@NovaCode37
NovaCode37 merged commit 4c836b9 into NovaCode37:main Oct 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation hacktoberfest-accepted Counts toward Hacktoberfest javascript Pull requests that update javascript code python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

onion_checker always finds nothing: Ahmia wants a token and DarkSearch is dead

2 participants