Skip to content

fix: connect playwright ws endpoint via protocol#21917

Merged
DIYgod merged 1 commit into
masterfrom
codex/playwright-protocol-bilibili-video
May 5, 2026
Merged

fix: connect playwright ws endpoint via protocol#21917
DIYgod merged 1 commit into
masterfrom
codex/playwright-protocol-bilibili-video

Conversation

@DIYgod
Copy link
Copy Markdown
Owner

@DIYgod DIYgod commented May 5, 2026

Involved Issue / 该 PR 相关 Issue

Close #

Example for the Proposed Route(s) / 路由地址示例

/bilibili/user/video/646730844

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

  • Connect PLAYWRIGHT_WS_ENDPOINT via the Playwright protocol endpoint with chromium.connect() instead of CDP, and pass remote launch options through launch-options.
  • Stop overriding Playwright's browser user agent in Node and Worker contexts.
  • Update the Bilibili user video browser fallback to open the user space page before /video, and wait for the JSON arc/search response across that navigation flow.
  • Extend the Bilibili browser fallback close timeout and tolerate closed remote pages while handling requestfinished events.

Test plan:

  • pnpm vitest run lib/bilibili-video-route.test.ts lib/utils/playwright.mock.test.ts
  • pnpm exec oxlint --type-aware lib/utils/playwright.ts lib/utils/playwright.worker.ts lib/utils/playwright.mock.test.ts lib/routes/bilibili/video.ts lib/routes/bilibili/cache.ts lib/bilibili-video-route.test.ts
  • pnpm exec oxfmt lib/utils/playwright.ts lib/utils/playwright.worker.ts lib/utils/playwright.mock.test.ts lib/routes/bilibili/video.ts lib/routes/bilibili/cache.ts lib/bilibili-video-route.test.ts --check
  • pnpm build:routes
  • Attempted live smoke for /bilibili/user/video/646730844?format=json with PLAYWRIGHT_WS_ENDPOINT=wss://cloudflare-patchright.rss3.workers.dev/playwright; repeated checks were blocked by the remote browser endpoint returning 500 or Bilibili returning 412 / risk-control responses.

@github-actions github-actions Bot added core enhancement route auto: not ready to review Users can't get the RSS feed output according to automated testing results labels May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Successfully generated as following:

http://localhost:1200/bilibili/user/video/646730844 - Failed ❌
HTTPError: Response code 503 (Service Unavailable)

Error Message:<br/>Error: Bilibili browser mode did not receive a JSON video list response within 45000ms: page.waitForResponse: Timeout 45000ms exceeded while waiting for event &quot;response&quot;
Route: /bilibili/user/video/:uid/:embed?
Full Route: /bilibili/user/video/646730844
Node Version: v24.15.0
Git Hash: 72d47469

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

\n## Auto Review\n- [Rule 21] lib/utils/playwright.ts, lib/utils/playwright.worker.ts: Removed User-Agent configuration for Playwright browsers instead of using RSSHub's built-in `config.trueUA` for requests requiring realistic browser headers. Restore UA settings with `config.trueUA` (e.g., add `--user-agent=${config.trueUA}` to launch args and `userAgent: config.trueUA` to browser context options).

@DIYgod DIYgod merged commit 90b81b5 into master May 5, 2026
52 checks passed
@DIYgod DIYgod deleted the codex/playwright-protocol-bilibili-video branch May 5, 2026 14:17
FrancoBenedetti pushed a commit to FrancoBenedetti/RSSHub that referenced this pull request May 21, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

auto: not ready to review Users can't get the RSS feed output according to automated testing results core enhancement route

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant