douyin-downloader / auth
jiji262/douyin-downloader/auth/AGENTS.md
AGENTS.md12k starsChanged 24 days ago
What's in it
- auth
- Purpose
- Key Files
- For AI Agents
- Working In This Directory
- Testing Requirements
- Common Patterns
- Dependencies
- Internal
- External
<!-- Parent: ../AGENTS.md --> <!-- Generated: 2026-03-27 | Updated: 2026-03-27 --> # auth ## Purpose Manages Douyin authentication credentials — cookie storage/validation and MS token generation for API request signing. ## Key Files | File | Description | |------|-------------| | `__init__.py` | Exports `CookieManager`, `MsTokenManager` | | `cookie_manager.py` | Stores, validates, and serves cookies as dict or header string | | `ms_token_manager.py` | Generates/refreshes the `msToken` required by Douyin API endpoints | ## For AI Agents ### Working In This Directory - `CookieManager` is instantiated in `cli/main.py` and passed to all downloaders - Cookies come from YAML config, env vars, or auto-loaded JSON files (see `config/config_loader.py`) - `MsTokenManager` is used by `core/api_client.py` for request signing ### Testing Requirements - Tests: `tests/test_cookie_manager.py`, `tests/test_ms_token_manager.py` ### Common Patterns - Cookie validation checks for required Douyin cookie keys - All cookie values are sanitized via `utils.cookie_utils.sanitize_cookies()` ## Dependencies ### Internal - `utils/cookie_utils.py` — cookie parsing and sanitization helpers ### External - `aiohttp` — for token refresh HTTP calls <!-- MANUAL: -->
More agent context in jiji262/douyin-downloader
10 other files this repository gives its agents.
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

