Goal: Use a single entry point to process the share text of the same short video. TikHub provides structured data for Douyin, Xiaohongshu, and WeChat Channels, while Qingdou provides short video speech transcripts; the final return is a data summary and the Markdown transcript path.
First check the usage credentials
Before starting any extraction task, first run the read-only precheck:
python3 scripts/extract_video.py --check-keys
Based on credential_state process:
| Status | Capability | Must inform the user |
|---|---|---|
complete |
Both data and transcripts are available | Both parts can be executed |
data_only |
Only TikHub data queries are available | Only work/account data can be obtained; speech transcripts cannot be generated |
transcript_only |
Only Qingdou transcripts are available | Only speech transcripts can be obtained; TikHub work/account data cannot be queried |
unavailable |
Neither part is available | Currently unavailable; first explain the usage credentials, then guide the user through purchase and configuration |
When there is only one Key, it is allowed to continue, and the user is not required to obtain the other Key. Before execution, clearly state which part can be handled this time, and by default narrow the mode to the currently available side. If the user still requests both , keep the one-sided result and mark the other side as missing credentials.
When neither Key is available, stop extraction. Do not directly use terms such as "API Key" or "interface authentication" as the conclusion. First explain with the following sentence:
To make this Skill work, you need to first activate an external data service. An API Key is a string of usage credentials provided by the service provider after activation, and can be understood as a dedicated pass for this Skill to call the service. You do not need to understand the technical principles, and do not send it in chat.
Then tell the user: "Currently neither service has been activated. If you do not purchase and configure at least one, this Skill cannot be used." Then follow references/api-setup.md to complete requirement selection, purchase, credential storage, and connection testing.
Do not pay on behalf of the user, accept service agreements, or handle the complete Key. Do not ask the user to send the Key into the conversation. For the purchase entry point, step-by-step guidance, secure configuration script, and connection testing, see references/api-setup.md。
Each time a purchase or recharge address is shown to the user, the following notice must first be shown verbatim, and must not be omitted or rewritten:
dbskill is a free and open-source project and has no affiliation, cooperation, or interest relationship with TikHub or Qingdou. Recharge is decided by the user independently, and related transactions, services, disputes, and risks are borne by the user; except as otherwise provided by law, dbskill bears no liability.
When the user has not entered the purchase or recharge guidance, do not show it repeatedly.
Conversation requirements when credentials are missing
When any service is missing, the reply must form the following continuous path:
- First explain API Key in plain language;
- Let the user choose based on the result: full functionality, data only, or transcript only;
- Explain which service needs to be purchased for each choice, and what will be missing if only one is purchased;
- Show the fixed legal notice, then show the corresponding recharge address;
- Provide step-by-step instructions for registration/login, viewing the page plans, topping up, entering the personal center or key management page, and obtaining credentials;
- Tell the user not to send the credentials to the chat after obtaining them, and to reply "TikHub topped up", "Qingdou topped up", or "both topped up";
- After the user replies that they have topped up, guide them to run the secure configuration script in their local terminal:
python3 scripts/configure_api_key.py tikhub
python3 scripts/configure_api_key.py qingdou
The script will covertly read the credentials in the terminal and save them to a local private configuration; the full credentials must not be displayed in commands, replies, or logs. After saving, run --check-keysagain until the corresponding status becomes available.
Do not send only a link at once, and do not assume the user knows where to find the credentials. When the service provider's page names change, guide them using candidate locations such as "Personal Center", "API Key", "Key Management", and "Developer Settings"; if they still cannot find it, ask the user to send a screenshot of the page with the account, balance, and credentials masked, then continue locating.
When the user only invokes this Skill and has not yet provided a link or specified which type of result they need, after completing the credential pre-check, do only two things: explain the API Key and ask the user to reply 1、2 or 3 to choose full functionality, data only, or transcript only. After receiving the choice, then show the legal notice, the corresponding top-up address, and the purchase steps. If the user has already sent a video link or explicitly requested full extraction, default to full functionality without asking again.
Execute by default
Prefer standard input to prevent special characters in the shared text from being interpreted by the Shell:
python3 scripts/extract_video.py \
--output-dir "/绝对路径/短视频文字稿" \
--stdin
The default mode is both:
- Extract the link from the full shared text;
- Call the TikHub MCP according to the link platform: Douyin supports a user profile or a single post, while Xiaohongshu and WeChat Channels support a single video;
- Submit the full shared text to the Qingdou API and poll to obtain the transcript;
- Save the transcript according to
{输出目录}/{作者}/{标题}.md; - Output a JSON summary containing the credential status, a TikHub data summary, and the transcript file path.
If either TikHub or Qingdou fails, continue completing the other side, and mark it in the summary as partial_success. Results already obtained must not be discarded because one side failed.
Optional mode
Switch only when the user explicitly needs only one side's result, or when the pre-check confirms that only one side's Key is available:
python3 scripts/extract_video.py --mode data --stdin
python3 scripts/extract_video.py --mode transcript --stdin
data: query only TikHub data, supporting Douyin, Xiaohongshu, and WeChat Channels;transcript: extract only the transcript, supporting platforms that the Qingdou API can parse;both: execute both sides at the same time.
When the same source already exists, skip transcript writing by default to protect the user's edits; when the user explicitly requests regeneration, add --overwrite. When the full TikHub response is needed, add --raw-data。
Keys and fees
The script reads the Key in the following order:
- Environment variable:
TIKHUB_API_KEY、QINGDOU_API_KEY; - User-specified local file:
TIKHUB_API_KEYS_FILE、QINGDOU_API_KEYS_FILE; ~/.config/dbs/API_Keys.md;- macOS Keychain:
dbs-tikhub-api-key、dbs-qingdou-api-key。
It is forbidden to write the Key into the Skill, command parameters, Markdown, Git, or logs. Both TikHub queries and Qingdou transcription may incur charges; inform the user before execution. If the user has already explicitly requested extraction, there is no need to confirm again.
Data boundaries
- TikHub handles post/account profiles, statistics, and media metadata; for Douyin posts, prefer App V3, and when there is no valid data, fall back to Web only once; for Xiaohongshu, use App V2 video note details; for WeChat Channels, use Channels V2 post details.
- Qingdou handles the speech transcript. The main text faithfully preserves the content returned by the API, without adding, polishing, or correcting slips of the tongue.
- The current TikHub dedicated data parsing supports Douyin, Xiaohongshu, and WeChat Channels; other platforms that Qingdou can recognize can still perform transcript extraction only.
- Public, deleted, private, copyright, and visibility scope restrictions are subject to what the API returns; do not attempt to bypass them.
- Do not automatically download media, publish content, commit to Git, or push.
For TikHub call details, see references/tikhub-api.md; for Qingdou status codes and compatibility logic, see references/qingdou-api.md. Read them only when troubleshooting or maintaining the corresponding parts.
Delivery
After completion, report concisely:
- Which API Key is currently configured, and the range of available capabilities;
- Whether the data query succeeded, the MCP tool used, and whether an App → Web fallback occurred;
- Key work/account data;
- Whether the transcript succeeded, and the absolute path of the generated or skipped Markdown;
- The specific reason for a missing Key on one side or an execution failure;
- Whether the API explicitly returned that billing has occurred.
Do not display the API Key,batchId , or unnecessary internal request identifiers in the reply.
End directly after completing the current task. Only when the user explicitly asks about the next step and the current environment already has /dbs installed, briefly suggest: "When unsure about the next step, you can enter /dbs。」