feat(bilibili): support b23.tv short URL/short code resolution#740
Merged
jackwener merged 2 commits intojackwener:mainfrom Apr 3, 2026
Merged
feat(bilibili): support b23.tv short URL/short code resolution#740jackwener merged 2 commits intojackwener:mainfrom
jackwener merged 2 commits intojackwener:mainfrom
Conversation
Add resolveBvid() in utils.ts to automatically resolve b23.tv short URLs and short codes to BV IDs. Supports all input formats: - BV ID: BV1MV9NBtENN (pass through) - Short code: XYzsqGa - Short URL: https://b23.tv/XYzsqGa, b23.tv/XYzsqGa Uses Node.js https.get with 302 redirect only (no body download), typically ~100-250ms resolution time. Applied to: subtitle, comments, download commands.
- 5s timeout on https.get to prevent hanging on unresponsive b23.tv - Accept unknown input type with String() coercion - Simplify callers (remove redundant String().trim() wrappers) - Add unit tests for BV ID passthrough and edge cases
1 task
just-buer
pushed a commit
to just-buer/opencli
that referenced
this pull request
Apr 8, 2026
…ener#740) * feat(bilibili): support b23.tv short URL/short code resolution Add resolveBvid() in utils.ts to automatically resolve b23.tv short URLs and short codes to BV IDs. Supports all input formats: - BV ID: BV1MV9NBtENN (pass through) - Short code: XYzsqGa - Short URL: https://b23.tv/XYzsqGa, b23.tv/XYzsqGa Uses Node.js https.get with 302 redirect only (no body download), typically ~100-250ms resolution time. Applied to: subtitle, comments, download commands. * fix: add timeout, input coercion, and tests for resolveBvid - 5s timeout on https.get to prevent hanging on unresponsive b23.tv - Accept unknown input type with String() coercion - Simplify callers (remove redundant String().trim() wrappers) - Add unit tests for BV ID passthrough and edge cases --------- Co-authored-by: chenruinian <chenruinian@Sa1kas-MacBookPro.local> Co-authored-by: jackwener <jakevingoo@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
resolveBvid()inutils.tsto automatically resolve b23.tv short URLs and short codes to BV IDs.Supported input formats
BV1MV9NBtENN(pass through, no overhead)XYzsqGahttps://b23.tv/XYzsqGa,b23.tv/XYzsqGaHow it works
Uses Node.js
https.getto read only the 302 redirect Location header (~100-250ms, no body download).Applied to
subtitlecommandcommentscommanddownloadcommandTest
All three input formats produce identical results (104 subtitle items).