Skip to content

fix(parser): add native Douyin detail fallback - #100

Merged
wujunwei928 merged 2 commits into
wujunwei928:mainfrom
goxofy:worktree-douyin-native-recovery
Aug 21, 2026
Merged

fix(parser): add native Douyin detail fallback#100
wujunwei928 merged 2 commits into
wujunwei928:mainfrom
goxofy:worktree-douyin-native-recovery

Conversation

@goxofy

@goxofy goxofy commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a native fallback to Douyin's official Web detail endpoint when share-page HTML no longer embeds the work details.
  • Require a deployment-owned PARSE_VIDEO_DOUYIN_COOKIE; no third-party parsing service or hard-coded credential is used.
  • Add local signing, response validation, and actionable official status errors.
  • Document the optional deployment configuration and credential-handling boundary.

Validation

  • go test ./...
  • go vet ./...
  • go build ./...
  • docker build -t parse-video:douyin-native-recovery-04f1708 .
  • Verified parsing against an authorized, currently public Douyin share link.

Security

  • No real cookie, session identifier, or authorization value is included in this branch.
  • The configured cookie is sent only to the official www.douyin.com detail endpoint.

🤖 Generated with Claude Code

Tink and others added 2 commits August 20, 2026 12:08
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@wujunwei928 wujunwei928 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在独立 worktree 完成验证:

  • go build / go vet / 新增 6 个单测全过(SM3 标准向量、a_bogus 确定性、query 顺序锁定、mock 请求构造、官方错误透传、无 cookie 拒绝请求)
  • 原有抖音测试不回归;图集(isNote)路径不受影响
  • 真实解析对比:空壳分享页场景下,main 报模糊错误 get video info fail: - ,本 PR 无 cookie 时返回明确的配置错误,带 cookie 时正确构造含 a_bogus 的签名请求
  • 主路径(分享页含详情)不受影响,后备仅在数据缺失时触发

备注:本机网络无法访问 www.douyin.com,带真实 Cookie 的端到端签名验证依赖作者声明,建议合并后在有 Cookie 的部署环境再实测一次。两个不阻塞的小瑕疵:douyinABogusUserAgentCode 32 字节表仅用 2 个元素;UA 写 Chrome/90 但 query 里 browser_version=130,指纹不一致或增加风控风险。

@wujunwei928
wujunwei928 merged commit 57590df into wujunwei928:main Aug 21, 2026
2 of 4 checks passed
@goxofy
goxofy deleted the worktree-douyin-native-recovery branch August 21, 2026 07:08
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.

2 participants