Skip to content

feat: add RedTube email scan module - #417

Merged
kaifcodec merged 1 commit into
kaifcodec:mainfrom
brunolm:feat/add-redtube-email-module
Jul 19, 2026
Merged

feat: add RedTube email scan module#417
kaifcodec merged 1 commit into
kaifcodec:mainfrom
brunolm:feat/add-redtube-email-module

Conversation

@brunolm

@brunolm brunolm commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an email-based RedTube account check to email_scan/adult/, filling one of the missing adult modules.

How it works

Mirrors the existing pornhub.py pattern (RedTube is the same MindGeek/Aylo network):

  1. GET /register to scrape the per-session page_params.token (note: the token ends in a literal . that must be preserved, or it's rejected).
  2. POST /user/create_account_check with check_what=email — RedTube returns the same structured JSON as Pornhub.

Response mapping:

Response Result
create_account_passed Not Registered
create_account_failed + already registered Registered
create_account_failed + "does not meet our registration requirements" (valid email) Registered
bare "NOK" string / HTTP 429 Rate limited (error)

Shared email validation

Extracted a reusable is_valid_email helper into core/helpers.py (previously an inline regex duplicated twice in __main__.py). The new regex is stricter and more reliable, inspired by the email-validator package:

  • proper dot-atom local part (rejects leading/trailing/double dots)
  • valid domain labels (rejects hyphen-edge and empty labels)
  • alphabetic TLD (≥2 chars; rejects 1-char and numeric TLDs)
  • RFC 5321 length limits and fullmatch (rejects trailing-newline edge case)

The two existing CLI call sites now reuse the helper.

Testing

  • Verified live against the RedTube endpoint (passed / registered / rate-limited paths).
  • Validator checked against the top 10 mainstream email providers and a range of valid/invalid edge cases.
  • pytest tests/test_helpers.py: all email-format tests pass (the 2 *_unreadable failures are pre-existing Windows chmod(0) no-ops, unrelated to this change).
Add email-based RedTube account check via the create_account_check
endpoint. Extract a shared is_valid_email helper with stricter
RFC 5322-ish validation and reuse it in the CLI's email-format checks.
@kaifcodec

Copy link
Copy Markdown
Owner

@brunolm Thank you for the PR and the helper function for email validation.

@kaifcodec
kaifcodec merged commit 95117f7 into kaifcodec:main Jul 19, 2026
2 checks passed
@kaifcodec kaifcodec added email module addition PRs or issues related to new email_scan module additions enhancement New feature, request, code improvements/upgrade, performance boost labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

email module addition PRs or issues related to new email_scan module additions enhancement New feature, request, code improvements/upgrade, performance boost

2 participants