Skip to content

feat(tiktok): add TikTok adapter with 15 commands#202

Merged
jackwener merged 2 commits intojackwener:mainfrom
0xsline:feat/tiktok-adapter-v2
Mar 21, 2026
Merged

feat(tiktok): add TikTok adapter with 15 commands#202
jackwener merged 2 commits intojackwener:mainfrom
0xsline:feat/tiktok-adapter-v2

Conversation

@0xsline
Copy link
Contributor

@0xsline 0xsline commented Mar 21, 2026

Summary

Add comprehensive TikTok adapter with 15 commands covering read operations, social interactions, and content engagement.

New Commands

Read Commands

Command Description Example
profile User profile info opencli tiktok profile --username tiktok
search Search videos opencli tiktok search --query "cooking" --limit 10
explore Trending videos opencli tiktok explore --limit 20
user User's recent videos opencli tiktok user --username tiktok
following Accounts you follow opencli tiktok following
friends Friend suggestions opencli tiktok friends --limit 10
live Live streams opencli tiktok live --limit 10
notifications Activity notifications opencli tiktok notifications

Write Commands

Command Description Example
like Like a video opencli tiktok like --url "https://..."
unlike Unlike a video opencli tiktok unlike --url "https://..."
save Add to Favorites opencli tiktok save --url "https://..."
unsave Remove from Favorites opencli tiktok unsave --url "https://..."
follow Follow a user opencli tiktok follow --username tiktok
unfollow Unfollow a user opencli tiktok unfollow --username tiktok
comment Comment on a video opencli tiktok comment --url "https://..." --text "Great!"

Technical Notes

  • Profile uses __UNIVERSAL_DATA_FOR_REHYDRATION__ server-rendered data parsing
  • Search uses internal /api/search/general/full/ endpoint
  • Explore/live use DOM scraping with data-e2e semantic selectors
  • Write commands use DOM button clicking (like-icon, undefined-icon for favorites, comment-icon)
  • Comment expands the comment panel first by clicking comment-icon, then types via execCommand('insertText')
  • TikTok requires an active login session in the Browser Bridge window

Test plan

  • profile --username tiktok — 93.4M followers, 455.8M likes, verified
  • search --query cooking — returns videos with plays/likes/comments/shares
  • explore --limit 5 — trending videos with view counts
  • user --username tiktok — video list with view counts
  • following — shows followed accounts
  • friends --limit 5 — suggestions (tate mcrae, The Rock, etc.)
  • live --limit 5 — live streams with viewer counts
  • notifications — activity panel
  • like/unlike — like count changed 1152→1153→1152 (verified real interaction)
  • save/unsave — favorites count changed 132→133→132 (verified real interaction)
  • follow/unfollow — verified real interaction
  • comment — successfully posted "love this 🔥" (verified real comment)
  • Doc coverage: 49/49 adapters documented
  • All 258 existing unit tests pass (zero regression)

0xsline added 2 commits March 21, 2026 22:52
TikTok (15 commands, browser mode):

Read commands:
- profile: user profile info via rehydration script parsing
- search: search videos via internal search API
- explore: trending videos from explore page (DOM scraping)
- user: recent videos from a user page (DOM scraping)
- following: list accounts you follow
- friends: friend suggestions
- live: browse live streams with viewer counts
- notifications: activity notifications

Write commands (verified with real interactions):
- like/unlike: like or unlike a video by URL
- save/unsave: add or remove video from Favorites
- follow/unfollow: follow or unfollow a user
- comment: comment on a video

All write operations verified with live TikTok interactions.
@jackwener jackwener merged commit 4391ccf into jackwener:main Mar 21, 2026
12 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