RSSHub/lib/routes/zhihu
Dzming Li 9d85d44492
fix(route/zhihu): generate __zse_ck with JSDOM (#22319)
* fix(route/zhihu): obtain __zse_ck from a browser session

`__zse_ck` is computed at runtime by Zhihu's JS from the device fingerprint
and `d_c0`, rotates every few days, and is cross-checked against `d_c0` by
the backend, so it has to come from a real browser session. Drive a browser
seeded with the configured cookies (including the `z_c0` login cookie that
most endpoints now require) to compute a fresh, consistent `__zse_ck`,
harvest the cookie jar, and cache it for 30 minutes so it is refreshed
automatically.

Recommended ZHIHU_COOKIES: "d_c0=...; z_c0=..." (omit `__zse_ck`).

* fix(route/zhihu): fetch posts profile via API instead of HTML

The user's HTML homepage (www.zhihu.com/people/:id) is now rate-limited
(403) more aggressively than the API, which broke /zhihu/posts on the
profile fetch even though the article-list API works. Read the profile
(name, headline, avatar) from /api/v4/members/:id instead.

* fix(route/zhihu): generate __zse_ck with JSDOM

* fix(route/zhihu): use members API for org posts

---------

Co-authored-by: DzmingLi <news@dzming.li>
2026-07-13 19:21:57 +08:00
..
bookstore
execlib chore(deps-dev): bump eslint-plugin-unicorn from 66.0.0 to 68.0.0 (#22310) 2026-06-20 23:11:27 +08:00
pin chore(deps-dev): bump eslint-plugin-unicorn from 66.0.0 to 68.0.0 (#22310) 2026-06-20 23:11:27 +08:00
xhu style: auto format 2026-05-07 21:41:39 +00:00
activities.ts chore(deps-dev): bump eslint-plugin-unicorn from 64.0.0 to 65.0.0 (#22219) 2026-06-09 00:08:15 +08:00
all-collections.ts
answers.ts
check-cookie.ts
collection.ts style: auto format 2026-06-16 06:45:07 +00:00
daily-section.ts
daily.ts
hot.ts
namespace.ts style: auto format 2026-05-07 20:42:08 +00:00
posts.ts fix(route/zhihu): generate __zse_ck with JSDOM (#22319) 2026-07-13 19:21:57 +08:00
question.ts
timeline.ts chore(deps-dev): bump eslint-plugin-unicorn from 65.0.1 to 66.0.0 (#22274) 2026-06-16 14:43:42 +08:00
topic.ts
types.ts
utils.ts fix(route/zhihu): generate __zse_ck with JSDOM (#22319) 2026-07-13 19:21:57 +08:00
weekly.ts
zhuanlan.ts