Skip to content

fix: update douyin work detail metrics capture - #61

Open
arreboil wants to merge 4 commits into
XBuilderLAB:mainfrom
arreboil:codex/fix-douyin-work-detail
Open

arreboil wants to merge 4 commits into
XBuilderLAB:mainfrom
arreboil:codex/fix-douyin-work-detail

Conversation

@arreboil

@arreboil arreboil commented Jul 2, 2026 •

Copy link
Copy Markdown

Douyin Creator Center moved detailed analytics to the work-management detail page, so the old route could load without triggering the expected detail requests. This PR updates the route and preserves work-detail metrics and evidence for both videos and image posts.

Summary

  • Use /work-management/work-detail/<aweme_id> instead of the old /data/following/media?item_id=... route.
  • Collect overview, traffic analysis, audience analysis, and comment hot-word tabs when available.
  • Capture current work-detail endpoints and retain structured metrics such as completion rate, average watch time, and average image views.
  • Validate the work-detail UI and wait for valid metrics, including metrics received before opening Traffic Analysis, without requiring a video-only watch-time label.
  • Exclude account-wide overview responses and strip query strings from captured endpoint labels.
  • Save complete responses and visible page text to detail.json alongside report.md, including when the wrapper relocates the output.

Verification

  • Independently reran all 10 offline tests successfully. Three use actual Chromium with intercepted synthetic pages and responses, covering image posts without the watch-time label, image metrics arriving before the tab click, and video posts.
  • The browser tests also exercise the normal report writer and verify that both report.md and detail.json retain the captured data.
  • git diff --check passed.
python -m unittest discover -s adapters/perf-data/douyin-session -p 'test_detail*.py' -v

The original route fix was locally checked against a published image-text work. The latest combined revision has been rechecked with offline tests; a fresh check against the current authenticated image-post backend has not been performed. Test fixtures contain no real account data or credentials.

Credits

Includes supplemental validation, evidence preservation, image-post compatibility fixes, and regression tests from @zhu-siyuan via arreboil#1.

@arreboil
arreboil force-pushed the codex/fix-douyin-work-detail branch from fb755fb to 06280db Compare July 2, 2026 02:25
@zhu-siyuan

Copy link
Copy Markdown

Thanks for this fix. I independently encountered the same outdated detail route and initially opened #78 before noticing this PR; that duplicate is now closed.

I've submitted a small follow-up directly against your PR branch: arreboil#1

It preserves your route change, all four analytics tabs, and structured metrics. The incremental additions are explicit login/wrong-page/empty-capture failures, exclusion of account-wide dashboard responses, query-string removal from endpoint labels, full detail.json evidence preservation, and seven regression tests. A read-only test against an authenticated published video also retrieved summary, watch-time and retention data successfully. No account data or credentials are included.

The follow-up is based directly on your 06280db commit and contains a single supplemental commit, 03fce3f, so it can be merged or cherry-picked into this PR without duplicating the original route fix.

@arreboil
arreboil marked this pull request as ready for review October 25, 2026 13:33
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