Skip to content

overtimepog/uc-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uc-cli — unknowncheats.me in your terminal

Browse forums, threads, and search UnknownCheats from the command line. Handles Cloudflare bypass, authenticated sessions, and clean terminal output.

Install

pip install git+https://github.com/overtimepog/uc-cli.git
# or for dev:
git clone https://github.com/overtimepog/uc-cli.git
cd uc-cli && pip install -e .

Requires Python 3.9+.

Usage

Browse

# List forum categories
uc forums

# List threads in a forum (by URL slug)
uc threads anti-cheat-bypass
uc threads counter-strike-2-a

# View a thread — accepts ID, URL, or path
uc thread 753248
uc thread https://www.unknowncheats.me/forum/anti-cheat-bypass/753248-steelseries-sonar.html
uc thread anti-cheat-bypass/753248-slug.html

# Search (experimental)
uc search "gpu spoof"

Auth

uc login       # prompts for username + password (or use -u/-p flags)
uc whoami      # check login status
uc logout      # clear session

Sessions persist automatically — cookies are saved to ~/.config/uc-cli/cookies.json and reused across invocations. If uc whoami shows "Not logged in", re-run uc login.

Thread reference formats

All of these work with uc thread:

Input Example
Numeric ID 753248
Full URL https://www.unknowncheats.me/forum/anti-cheat-bypass/753248-slug.html
Relative path anti-cheat-bypass/753248-slug.html

How it works

  • Transport: cloudscraper session (Cloudflare bypass) with graceful fallback to requests
  • Parsing: BeautifulSoup + lxml
  • Auth: GET index → extract CSRF token → POST login → persist cookies

Dev

pip install -e ".[dev]"
pytest -v          # 26 tests with mock HTML fixtures
pytest --cov=uc_cli

Project layout

uc-cli/
  uc_cli/
    cli.py       — Click CLI (forums, threads, thread, search, login, logout, whoami)
    scraper.py   — fetch_page, parsing (forums, threads, search), session management
    auth.py      — login, logout, session persistence (~/.config/uc-cli/cookies.json)
  tests/
    conftest.py           — shared fixtures
    fixtures/*.html       — mock HTML
    test_scraper.py       — 7 tests
    test_cli.py           — 8 tests
    test_auth.py          — 11 tests
  pyproject.toml

Known issues

  • Forum listing (uc forums) may return empty — the live homepage DOM differs from test fixtures. Use uc threads <slug> directly as a workaround.
  • Sticky threads show blank author — intentional; forum announcements don't have the usual "by username" markup.
  • Search is experimental — not verified against all query types, may return empty.
  • Cloudflare 403: ensure cloudscraper>=1.2 is installed. Stale versions get cf-mitigated: challenge.
  • Cookie expiry: UC sessions can expire server-side even if the cookie file exists. Re-run uc login.

License

MIT

About

unknowncheats in your terminal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages