Skip to content

fix(parser): restore cookie-free Douyin parsing with anonymous ttwid - #102

Open
saberc8 wants to merge 1 commit into
wujunwei928:mainfrom
saberc8:codex/fix-douyin-anonymous-ttwid
Open

fix(parser): restore cookie-free Douyin parsing with anonymous ttwid#102
saberc8 wants to merge 1 commit into
wujunwei928:mainfrom
saberc8:codex/fix-douyin-anonymous-ttwid

Conversation

@saberc8

@saberc8 saberc8 commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • Register an anonymous ttwid through ByteDance's official union endpoint when the share page no longer embeds videoInfoRes.
  • Use that anonymous cookie for the existing signed official Douyin detail request, while preserving PARSE_VIDEO_DOUYIN_COOKIE as an optional deployment-owned override.
  • Cover anonymous registration, configured-cookie behavior, and registration failures with tests, and update the related documentation.

Root cause

Douyin share pages still expose window._ROUTER_DATA, but no longer include videoInfoRes. The native detail fallback added in #100 reaches the correct official endpoint, but requires every deployment to provide an account Cookie, so a default installation still cannot parse current Douyin links.

Validation

  • go test ./...
  • go vet ./...
  • go build ./...
  • git diff --check
  • Parsed https://v.douyin.com/SXBboRbpXC4/ with PARSE_VIDEO_DOUYIN_COOKIE unset; verified the expected author/title/cover and a non-empty video URL.
  • Verified the returned media URL with a browser User-Agent: HTTP 206, video/mp4.

Security

  • Uses only ByteDance/Douyin official endpoints.
  • Does not add a third-party parsing service or hard-coded credential.
  • A configured deployment Cookie is sent only to the official Douyin detail endpoint and is never sent to the anonymous registration endpoint.

Fixes #98

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.

抖音解析失效:分享页已不再内嵌 videoInfoRes,get video info fail

1 participant