RSSHub/lib/routes/baidu
FlanChan 6f50d57298
feat(route/baidu): add BAIDU_COOKIE support and extract shared … (#21663)
* feat(route/baidu): add support for BAIDU_COOKIE in various baidu tieba routes and implement user post retrieval

* refactor(forum): improve code readability and structure in forum.tsx

* feat(post): enhance time parsing and reply link generation in post.tsx

* feat(route/baidu): refactor page content retrieval and enhance cookie handling in forum, post, search, and user routes

* refactor(route/baidu): refactor cookie parsing logic and improve code formatting

- Refactor parseBaiduCookies function to use chained array methods for better readability
- Simplify cookie parsing by trimming and filtering empty strings before mapping
- Remove redundant comments in common.ts and post.tsx files
- Improve code formatting by removing excessive blank lines
- Maintain same functionality while enhancing code maintainability

* feat(route/baidu/tieba): add BAIDU_COOKIE support and extract shared utilities  Add common.ts for cookie parsing, page retrieval, security check and URL normalization. Refactor forum, post, search and user routes to use shared utilities. Preserve rich text content in post replies. Support direct reply links. Fix cookie value parsing for cookies containing '=' character.

Route/baidu

* style(baidu/tieba): fix code formatting and whitespace issues

- Remove trailing whitespace from empty lines
- Ensure consistent line endings in utility functions

* feat(route/baidu): add retry mechanism for transient errors in page content retrieval (#2)

* fix: improve page content retrieval

* style: auto format

* fix: improve URL encoding and enhance content retrieval logic

* feat(route/baidu/tieba): migrate forum route to use client API

Replace Puppeteer-based HTML scraping with direct HTTP API call
to /c/f/frs/page. The API requires BDUSS + MD5 client signature,
eliminating the need for browser rendering and reducing resource
usage. Also updated thread parsing to match the JSON response
structure (thread_list at top level, author via user_list map,
images from first_post_content type 3 items).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* revert: unnecessary changes mentioned in https://github.com/DIYgod/RSSHub/pull/21663#discussion_r3051928062

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-30 12:15:32 +08:00
..
gushitong refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
tieba feat(route/baidu): add BAIDU_COOKIE support and extract shared … (#21663) 2026-07-30 12:15:32 +08:00
namespace.ts
search.tsx refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00
top.tsx refactor: replace art template with jsx (#20777) 2025-12-29 12:27:32 +08:00