Add Valorant Riot ID validation module#266
Open
SylvainM98 wants to merge 3 commits intokaifcodec:mainfrom
Open
Add Valorant Riot ID validation module#266SylvainM98 wants to merge 3 commits intokaifcodec:mainfrom
SylvainM98 wants to merge 3 commits intokaifcodec:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usescurl_cffiwith Chrome TLS fingerprinting to bypass the block.How it works
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.Queries tracker.gg API:
GET /api/v2/valorant/standard/profile/riot/{Name}%23{Tag}Handles all response cases:
Edge cases tested
#, whitespace trimmingNew dependency
Adds
curl_cffi>=0.7,<1topyproject.toml. Required becausehttpxgets blocked by Cloudflare's TLS fingerprint detection.curl_cffiuses 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→ Foundpython3 -m user_scanner -u 'xyzbidon99999#0000' -m valorant→ Availablepython3 -m user_scanner -u 'TenZ' -m valorant→ Error (missing tag)python3 -m user_scanner -u 'Name#Tag#Extra' -m valorant→ Error (multiple #)