← Back
sitimas9

sitimas9/cdcrafthh

CodeCraft-style account farm — OAuth + coupon + API key harvest

View on GitHub ↗
Stars
224
Forks
1
Watchers
224
Open issues
0
Contributors
1
Language
Python
License
—
Default branch
main
Created Sep 7, 2026Updated Sep 7, 2026

Star growth

Today—
This week—
This month—

Star history will appear here once this repo has been tracked for a couple of days.

README

cdcrafthh 🚀

Automated CodeCraft API account farm — register via Google OAuth, apply the 100%-off yearly coupon, and harvest the generated cc_... API keys.

⚠️ Educational / research use only. Replace the placeholders below with your own accounts and credentials. Do not use accounts you don't own.

How it works

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│  Google OAuth   │───▶│  Apply coupon    │───▶│  Checkout $0    │
│  (headless CH)  │    │  (DEVWEEK-like)  │    │  (order success)│
└─────────────────┘    └──────────────────┘    └────────┬────────┘
                                                        │
                                                        ▼
                                            ┌─────────────────────────┐
                                            │  Create API Key         │
                                            │  → cc_xxxxxxxxxxxx      │
                                            │  → saved to keys file   │
                                            └─────────────────────────┘
  1. Browser step — Playwright Chromium logs into Google using a saved storage_state (password auto-filled if the session expired), then completes the OAuth consent back to the platform.
  2. HTTP step — all checkout calls are done via fetch() inside the page session (critical: a separate curl session breaks CSRF + flash-session, which is why the key never appears).
  3. Key extraction — the newly created key (cc_ + 50 chars) is scraped from the dashboard DOM.

Setup

pip install playwright curl_cffi
playwright install chromium

Prepare your state files

Each Google account needs a Playwright storage_state JSON in ./states/, named after the account:

states/
  YourAccountName.json      # storage_state from a logged-in Google session
  AnotherAccount.json

Tip: log into Google once in any Playwright script and save with await context.storage_state(path="states/YourAccountName.json").

Configuration (PLACEHOLDERS — edit before running)

Open cdcrafthh.py and replace:

Placeholder What it is
YOUR_EMAIL_DOMAIN email domain of your accounts (<name>YOUR_EMAIL_DOMAIN)
YOUR_ACCOUNT_PASSWORD shared Google account password
YOUR_COUPON_CODE the 100%-off coupon code
YOUR_PLAN_ID numeric plan ID from the checkout endpoint
YOUR_COUPON_AMOUNT amount value sent with the coupon request
YOUR_BILLING_CYCLE monthly / yearly
YOUR_BASE_URL target platform base URL

Usage

# single account
python3 cdcrafthh.py <StateNameWithoutJson> <email>

# batch (all state files, resume-safe — skips already-harvested emails)
python3 cdcrafthh_batch.py 0 300

Output: codecraft_keys.txt → email|cc_xxxxxxxx (one per line).

Troubleshooting

Symptom Fix
OAUTH_FAIL storage_state expired → re-login & re-save, or let the script fill the password
checkout OK but no cc_ key you're doing checkout in a separate curl session — all calls must be fetch() inside the page
duplicate key-name error key name is derived from the email; clear codecraft_keys.txt before rerun
proxy needed add proxy={"server":"socks5://..."} to browser.launch()

Files

  • cdcrafthh.py — single-account worker
  • cdcrafthh_batch.py — batch runner (resume-safe)

Made with 💚 — fork it, tweak the placeholders, and go harvest responsibly.