mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
a6d1eca204
Two issues surfaced post-merge of #1110 by the Copilot reviewer: 1. Help text and docs advertise `video URL` as a valid input for `opencli bilibili video <bvid>`, but the original implementation delegated the whole input to `resolveBvid()` — which only recognises bare `BV...` IDs and `b23.tv` short codes. A canonical bilibili URL like `https://www.bilibili.com/video/BV.../` therefore got rewritten to `https://b23.tv/www.bilibili.com/video/BV.../` and failed before ever calling the view API. Fix: pre-extract the BV ID from `bilibili.com/video/<BV>...` and `bilibili.com/bangumi/play/<BV>...` URLs (www / m. / with or without query string) in `video.js`, and fall through to `resolveBvid()` only for bare BV IDs and `b23.tv` links. 2. `description` was being truncated to 200 chars with whitespace collapsed before being returned. JSON/YAML consumers silently lost the full `desc` value. Other bilibili adapters return raw fields. Fix: return the full `d.desc` verbatim and let consumers/display layers handle formatting. Adds four regression tests for the URL paths (full URL, URL with query string, m.bilibili.com mobile URL) and one for description integrity (> 200 chars, preserved verbatim). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>