返回 douyin-downloader
AGENTS.md
根目录 / tools / AGENTS.md
1 <!-- Parent: ../AGENTS.md -->
2 <!-- Generated: 2026-03-27 | Updated: 2026-03-27 -->
3
4 # tools
5
6 ## Purpose
7 Standalone utility scripts — currently contains browser-based cookie fetching via Playwright.
8
9 ## Key Files
10
11 | File | Description |
12 |------|-------------|
13 | `__init__.py` | Package docstring |
14 | `cookie_fetcher.py` | Launches Playwright browser to authenticate with Douyin and extract cookies |
15
16 ## For AI Agents
17
18 ### Working In This Directory
19 - `cookie_fetcher.py` requires the `[browser]` optional dependency (`playwright`)
20 - It automates browser login and exports cookies to JSON format
21 - This is a user-facing utility, not part of the core download pipeline
22
23 ### Testing Requirements
24 - Tests: `tests/test_cookie_fetcher.py`
25 - Tests mock Playwright — do not launch real browsers
26
27 ### Common Patterns
28 - Playwright async API for browser automation
29 - Cookie export as JSON dict for use with `ConfigLoader`
30
31 ## Dependencies
32
33 ### Internal
34 - `utils/cookie_utils.py` — cookie sanitization
35
36 ### External
37 - `playwright` — browser automation (optional dependency)
38
39 <!-- MANUAL: -->
40
40 lines MARKDOWN