Zhihu Favorites
Use the scripts in scripts/ to read your Zhihu collections and extract readable text for summarization.
Cookie auth (recommended)
- •CookieCloud: set
COOKIECLOUD_UUID+COOKIECLOUD_PASSWORD(also acceptsCOOKIECLOUDUUID/COOKIECLOUDPASSWORD)- •Optional:
COOKIECLOUD_SERVER_URL(default:http://127.0.0.1:8088)
- •Optional:
- •Or set
ZHIHU_COOKIES/ZHIHU_COOKIE(rawCookie:header string) - •Or pass
--cookie 'z_c0=...; ...'to a script
Quick Start
Probe login / current user:
bash
docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_me.py
List collections (favorites folders):
bash
docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_collections.py --limit 50
List items inside a collection:
bash
docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_collection_items.py --collection-id <id> --limit 50
Fetch full content for an answer/article (plain text output by default):
bash
docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_item_content.py --url 'https://www.zhihu.com/question/.../answer/...' docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_item_content.py --url 'https://zhuanlan.zhihu.com/p/...'
JSON mode (for piping / automation):
- •Add
--jsonto any script.
How To Answer Common Requests
- •"帮我看看知乎的收藏夹"
- •Run
docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_collections.py --json --limit 50and showid/title/item_countso the user can pick a collection.
- •Run
- •"我最近收藏了哪些回答/文章?"
- •Pick a collection and run
docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_collection_items.py --collection-id <id> --limit 20(items come in API order).
- •Pick a collection and run
- •"这篇回答/文章讲了什么?"
- •Run
docker compose run --rm runner python skills/zhihu-favorites/scripts/zhihu_item_content.py --url ...and summarize from the extracted plain text.
- •Run
Troubleshooting
- •"No cookies found": set CookieCloud env vars or
ZHIHU_COOKIES, or pass--cookie. - •403 / captcha / empty payloads: cookies may be expired; re-sync CookieCloud. If Zhihu blocks direct API, use Playwright as fallback (see
references/research.md).