Communitygithub.com

geoqiao/short-video-skills

Daily scheduled read-only collection of short video performance data (views, completion rate, 2-second skip or fast swipe, average watch time, likes/bookmarks/shares/comments, follower changes, traffic sources, search terms, retention curves) from Douyin creator center, Weixin Video Account, and Xiaohongshu creator platform. Saves data as date-named snapshots, then organizes them into a time series per video. Collection time is configurable. Suitable for daily collection, ad-hoc catch-up, tracking data trends for a single video, or aggregating data before weekly reports.

What is short-video-skills?

This skill enables AI agents like Claude Code, Cursor, and Codex to autonomously collect short video performance metrics from three major Chinese platforms (Douyin, Weixin Video Account, Xiaohongshu) in a read-only manner. It uses playwright-cli to connect to a user's already-logged-in Chrome browser, opens the necessary creator backend pages to scrape displayed data, and then closes them—without clicking any buttons or changing any settings. The skill captures metrics such as views, completion rate, 2-second skip/fast swipe rate, average watch time, likes, bookmarks, shares, comments, follower changes, traffic sources, search terms, and retention curves. Data is saved as daily snapshot files named by date, making it easy to calculate incremental changes or aggregate weekly statistics. It supports scheduled daily collection at a user-specified time, ad-hoc catch-up for specific platforms, and provides a stats script to display per-video time-series tables. The skill is designed for developers running AI agents on their local machine who need automated, non-destructive data harvesting for analysis and reporting.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/geoqiao/short-video-skills/tree/HEAD/skills/video-data

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Collect Short Video Data

Creator backends only show current cumulative values—there's no way to see what yesterday's numbers were. Saving a snapshot at the same time each day lets you calculate the daily increment and detect changes after any adjustments.

Collection uses playwright-cli to connect to a user's already-logged-in Chrome, opens the relevant tab to read the data loaded on the backend page, then closes it. It is read-only: no buttons are clicked, no settings are changed.

Preparation

  • playwright-cli and its accompanying Chrome extension; Chrome must be logged into the platforms you want to collect. For scheduled collection, Chrome must be running and the computer must not sleep.
  • Place a video-data.json file in the project root directory (follow video-data.example.json as a template):
FieldDefaultDescription
time"12:10"Daily collection time, HH:MM, in the local timezone
timezoneLocal timezoneDetermines which date's snapshot file is used
platformsCollect all threeChoose from douyin, weixin, xiaohongshu
outDirdata/snapshotsSnapshot directory, relative to the project root

Choose a time after content is published and consistent each day. Backend data for each platform has a delay; videos posted in the evening are more stable when collected around noon the next day.

Collection

Run from the project root directory (<skill> is the path to this skill's folder):

node <skill>/scripts/collect.mjs            # Collect all platforms in config
node <skill>/scripts/collect.mjs douyin     # Catch up only one platform
  • Output is saved as <outDir>/<date>.json. Re-running on the same day merges results: successfully collected data overwrites previous data for that platform, and failed platforms keep the existing snapshot from that day.
  • The file is written after each platform completes, so an interruption won't lose already-collected data.
  • Exit code is 1 when a platform fails; the terminal shows which platform and what error. not_logged_in means the login has expired—ask the user to re-login in Chrome. For other errors, manually retry once first; Douyin occasionally has temporary failures.
  • Do not run while the user has an unsaved form open in Chrome: the collection opens new tabs, which might steal focus from the form.

Scheduling

node <skill>/scripts/schedule.mjs prints a cron expression and a crontab line based on the time field. It only prints, does not modify the system setting. To change the time, update video-data.json and then recreate the scheduled task. Choose one of two options:

  • Agent's built-in scheduler (recommended): Create a scheduled task using the printed cron expression, with a prompt like "Run the video-data collection in , retry failed platforms once, and report the number of works and followers for each platform." The agent can read errors and perform catch-up collections.
  • System crontab: The user manually adds the printed line into crontab -e. Logs are written to collect.log in the snapshot directory.

Before creating a scheduled task or modifying the crontab, show the time and command to the user first.

What's in the Snapshot

Each platform has a section: account (nickname, followers), works[] (each work includes id, desc, publishedAt, durationSec, metrics), and optionally error or warning. Ratios are decimals (0.55 means 55%).

PlatformExtra DataLimitations
DouyinTraffic sources, chapter click rates, search terms, retention curves for works from the last 30 days (up to 12 works)Work list reads at most 5 pages
WeixinDaily trends for plays, likes, shares, and followers per account, broken down by sourceWork list only reads the first page; writes a warning if there are more pages
XiaohongshuImpressions, cover click-through rate, 2-second skip rate, 5-second completion rateOnly collects video notes from the last 30 days (up to 12 works); no source analysis if views are under 100

Metrics with different definitions cannot be directly compared: Douyin and Xiaohongshu's early departure metric is "2-second skip rate," while Weixin's is "fast swipe rate" (fast_flip_rate).

Viewing Data

node <skill>/scripts/stats.mjs organizes all snapshots into a per-video table: daily plays, incremental plays, average play duration, completion rate, early departure rate, interactions, and follower growth, along with the latest traffic sources, search terms, and retention curves.

When the sample size is small, conclusions are marked as "insufficient sample." When comparing two videos, first compare the same number of hours after publication, then examine what changed.

What to Explain in the Delivery

  • Which platforms were collected, how many works and followers for each, and which platform failed and why.
  • The snapshot file path.
  • For scheduling: the cron expression, the time zone for the trigger time, and which scheduling method is being used.

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

Related Skills