Skip to content

fix(parser): restore Bilibili b23.tv short-link redirects - #101

Open
goxofy wants to merge 1 commit into
wujunwei928:mainfrom
goxofy:worktree-douyin-native-recovery
Open

fix(parser): restore Bilibili b23.tv short-link redirects#101
goxofy wants to merge 1 commit into
wujunwei928:mainfrom
goxofy:worktree-douyin-native-recovery

Conversation

@goxofy

@goxofy goxofy commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • restore parsing for Bilibili App share links using b23.tv short URLs
  • accept Resty's expected ErrAutoRedirectDisabled sentinel so the parser can inspect the first redirect response and extract its Location header
  • add deterministic, proxy-backed regression tests for successful redirects, missing locations, invalid redirect targets, transport errors, and direct BVID URLs

Root cause

The proxy-support migration changed Bilibili short-link handling from net/http with http.ErrUseLastResponse to Resty's NoRedirectPolicy().

Both approaches intentionally stop automatic redirects so the parser can manually read Location. However, net/http returns the intercepted response without an error, while Resty returns resty.ErrAutoRedirectDisabled together with the response. The existing Bilibili parser treated that expected Resty sentinel as a request failure before reading Location.

Validation

  • go test ./parser/ -run 'TestBiliBiliGetBvidFrom' -count=1
  • go test ./... -count=1
  • go vet ./...
  • go test -race ./parser/... -count=1
  • verified the supplied public b23.tv share link through the CLI end to end

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant