X Tutup
Skip to content

Add Valorant Riot ID validation module#266

Open
SylvainM98 wants to merge 3 commits intokaifcodec:mainfrom
SylvainM98:add/valorant-module
Open

Add Valorant Riot ID validation module#266
SylvainM98 wants to merge 3 commits intokaifcodec:mainfrom
SylvainM98:add/valorant-module

Conversation

@SylvainM98
Copy link
Contributor

@SylvainM98 SylvainM98 commented Mar 3, 2026

Summary

Adds a Valorant module that checks if a Riot ID (Name#Tag) exists. Supersedes #24.

Why a new approach?

The original #24 used tracker.gg API with httpx, which now returns 403 due to Cloudflare protection added since Nov 2025. This module uses curl_cffi with Chrome TLS fingerprinting to bypass the block.

How it works

  1. Validates format: Requires exactly one # with non-empty name and tag. Without proper format, the API returns misleading results — this was the issue raised on Added valorant user validation #24.

  2. Queries tracker.gg API: GET /api/v2/valorant/standard/profile/riot/{Name}%23{Tag}

  3. Handles all response cases:

    Status Meaning Result
    200 Public profile Taken
    451 Private profile Taken
    404 + "has not played" Riot account exists, no Valorant data Taken
    404 + "could not find" Account does not exist Available

Edge cases tested

  • Format: empty, spaces, no tag, no name, multiple #, whitespace trimming
  • HTTP: pro players, non-existent accounts, 1-char name+tag, all-numeric, accents, spaces in name, HTML injection, path traversal
  • Rate limiting: stable with 0.5s intervals
  • Security: no injection risks (API returns safe JSON)

New dependency

Adds curl_cffi>=0.7,<1 to pyproject.toml. Required because httpx gets blocked by Cloudflare's TLS fingerprint detection. curl_cffi uses native libcurl with Chrome-grade TLS handshake, making requests indistinguishable from a real browser.

Test plan

  • python3 -m user_scanner -u 'TenZ#00005' -m valorant → Found
  • python3 -m user_scanner -u 'xyzbidon99999#0000' -m valorant → Available
  • python3 -m user_scanner -u 'TenZ' -m valorant → Error (missing tag)
  • python3 -m user_scanner -u 'Name#Tag#Extra' -m valorant → Error (multiple #)

Check if a Valorant Riot ID (Name#Tag) exists via tracker.gg API.

Uses curl_cffi with Chrome TLS fingerprint to bypass Cloudflare
protection that blocks standard HTTP clients. Handles all response
cases: public profile (200), private profile (451), account with
no Valorant data (404 + "has not played"), and non-existent (404).

Validates Name#Tag format client-side to prevent false positives
when no tag is provided.

Adds curl_cffi as a project dependency.

Ref kaifcodec#24
Validate that input contains exactly one # to prevent false
positives with malformed inputs like "Name#Tag#Extra".
curl_cffi has no type stubs available, causing mypy to fail CI.
Added type: ignore annotation on the import line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup