Skip to content

feat(douyin): add Douyin creator center adapter (14 commands, 8-phase publish pipeline)#416

Merged
jackwener merged 3 commits intojackwener:mainfrom
nianyi778:feat/douyin-adapter
Mar 25, 2026
Merged

feat(douyin): add Douyin creator center adapter (14 commands, 8-phase publish pipeline)#416
jackwener merged 3 commits intojackwener:mainfrom
nianyi778:feat/douyin-adapter

Conversation

@nianyi778
Copy link
Copy Markdown
Contributor

@nianyi778 nianyi778 commented Mar 25, 2026

Summary

  • 14 commands covering the full Douyin creator workflow: publish, draft, videos, drafts, delete, profile, update, hashtag (search/suggest/hot), location, activities, collections, stats
  • 8-phase publish pipeline: STS2 credentials → ApplyVideoUpload → TOS multipart upload (Node.js, resume support) → ImageX cover upload → enable video → transcode poll (encode=2) → content safety check → create_v2
  • Browser-fetch hybrid architecture: all creator.douyin.com signed API calls run via page.evaluate(fetch) (handles a_bogus signing automatically); large binary uploads go Node.js-direct with AWS Signature V4

Key technical notes

  • Only scheduled publishing supported (timing must be now+2h ~ now+14d)
  • TOS multipart upload with resume: progress stored at ~/.opencli/douyin-resume/<sha256>.json
  • Cover is required: if not supplied, uses poster_uri from transcode response
  • encode=2 signals transcode complete (not 1)
  • Double-serialized fields in create_v2 body (text_extra, activity, etc.) are JSON.stringify'd strings as required by the API

Files added

src/clis/douyin/
├── publish.ts              # 8-phase pipeline (13 args)
├── draft.ts                # Save as draft (phases 1-6 + create_v2 with is_draft:1)
├── videos.ts               # Work list with status filter
├── drafts.ts               # Draft list
├── delete.ts               # Delete work
├── update.ts               # Reschedule or update caption
├── profile.ts              # Account info
├── hashtag.ts              # search/suggest/hot sub-actions
├── location.ts             # POI search
├── activities.ts           # Official activity list
├── collections.ts          # Mix/collection list
├── stats.ts                # 7-day metrics trend
└── _shared/
    ├── types.ts            # Shared interfaces
    ├── sts2.ts             # STS2 temporary credentials
    ├── browser-fetch.ts    # page.evaluate(fetch) wrapper
    ├── tos-upload.ts       # TOS multipart + resume (AWS Sig V4)
    ├── imagex-upload.ts    # ImageX cover uploader
    ├── transcode.ts        # Transcode poller (encode=2)
    ├── creation-id.ts      # creation_id generator
    ├── timing.ts           # Schedule validation
    └── text-extra.ts       # Hashtag text_extra parser

Test plan

  • npx vitest run --project adapter — 124 tests, 0 failures
  • npx tsc --noEmit — clean

Requires: Chrome logged into creator.douyin.com with opencli browser bridge extension.

… publish pipeline)

- publish: 8-phase pipeline (STS2 → TOS multipart upload w/ resume → ImageX cover → transcode poll → safety check → create_v2)
- draft: save as draft (phases 1-6 + is_draft:1, no timing)
- videos/drafts/delete/profile/update: content management
- hashtag (search/suggest/hot) / location / activities / collections / stats: discovery & analytics
- _shared: tos-upload (AWS Sig V4, multipart, resume), imagex-upload, transcode poller (encode=2), browser-fetch, sts2, creation-id, timing, text-extra
- 124 tests, tsc clean
@nianyi778 nianyi778 force-pushed the feat/douyin-adapter branch from c81a143 to e1191da Compare March 25, 2026 07:16
@jackwener jackwener merged commit 39ca833 into jackwener:main Mar 25, 2026
22 checks passed
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