SuperAPI AI Directory

tiktok-home-downloader

General & other

View repository

Updated 10-16 04:53

About this skill

TikTok Profile Video Batch Extraction

Enter TikTok profile link → Pull profile works list → Parse download links → One-click download to local


Introduction

TikTok account profile video batch extraction tool. Simply provide a TikTok account profile link, and it automatically pulls the account profile's works list, parses the watermark-free video download direct links one by one, and supports one-click batch download to local.

Target Users

  • 🎬 Content creators — Save and study high-quality content from competitor accounts, deconstructing shooting and editing techniques frame by frame.
  • 📦 Operations / MCN — Batch backup influencer collaboration works, quickly complete background research and analysis.
  • 🎓 Knowledge learners — Stockpile tutorial videos offline for repeated viewing anytime.

Features

Feature Description
📋 Works retrieval Get account profile works (title, engagement data, work link) via profile link/handle
🔗 Link parsing Obtain watermark-free video download direct links one by one
📥 Batch download One-click download all works to local output/ directory
📊 Data display Markdown table / JSON dual-format output, including complete engagement data such as play count
📄 Pagination Supports pagination to view more works
📅 Date filtering Can select by work publish time
⚡ Rate protection Built-in request interval to avoid triggering rate limits

Usage Guide

Authentication (required reading before use)

This skill calls the redfox.hk API and requires obtaining an API Key first.

Go to Redfox Hub to obtain an API Key.

# 环境变量配置(推荐)
export REDFOX_API_KEY=ak_你的密钥

# Windows PowerShell
$env:REDFOX_API_KEY="ak_你的密钥"

How to obtain secUserId (account identifier acquisition guide)

secUserId is a string used internally by TikTok to identify an account, fixed to start with MS4w (e.g., MS4wLjABAAAA..., usually 40~60 characters). When the profile link / handle cannot be parsed (e.g., network restrictions, page anti-scraping), providing secUserId allows direct query. The acquisition methods are as follows:

Method 1: Mobile App share link (simplest, recommended)

  1. Open the TikTok App on your phone, search for and enter the target account profile
  2. Tap the "···" or share icon in the upper right corner → select "Share" → tap "Copy link"
  3. Paste it out to check: the share link contains the sec_uid=MS4w... parameter, in the form: https://www.tiktok.com/@xxx?sec_uid=MS4wLjABAAAA...&...
  4. Simply provide the complete share link to the skill, and the skill will automatically extract the secUserId from it

⚠️ Note: The share link must contain the sec_uid=MS4w... parameter. A regular profile link (e.g., https://www.tiktok.com/@tiktok, the link does not contain sec_uid= parameter) requires access to the TikTok page to parse, and may fail due to network restrictions or anti-scraping measures; share links with the sec_uid parameter can be queried directly, with the highest success rate.

Method 2: One-click extraction via browser developer tools

  1. After opening the account homepage, press F12 to open developer tools
  2. Switch to the Console tab
  3. Paste the following code and press Enter, and it will directly print the account's secUserId:
JSON.parse(document.getElementById('__UNIVERSAL_DATA_FOR_REHYDRATION__').textContent).__DEFAULT_SCOPE__['webapp.user-detail'].userInfo.user.secUid

FAQ

  • The copied secUserId is incomplete? Please confirm it starts with MS4w and that the entire string is copied completely; truncation in the middle will cause the query to fail.
  • The share link does not contain the sec_uid= parameter? This means what was copied is not a standard share link. Please obtain it again via "Share → Copy link", or use Method 2 instead.

For the core execution flow, data rules, and API description, see references/core_workflow.md

One-click installation

This skill is a standard Skill file package and is compatible with all AI Agent platforms that support the Skill mechanism.

Platform Installation method
Qoder Place this skill directory into .qoder/skills/ and restart
OpenClaw Place this skill directory into the corresponding skills directory and restart
WorkBuddy Place this skill directory into the corresponding skills directory and restart
Codex Place this skill directory into the corresponding skills directory and restart
Claude Code Place this skill directory into ~/.claude/skills/ and restart

CLI command line

# 基础用法:拉取作品并解析下载链接(不下载文件)
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "https://www.tiktok.com/@tiktok"

# 也可以直接输入 @handle
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok"

# 下载视频到本地
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok" --download

# 指定下载目录
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok" --download --output-dir ./my_videos

# JSON 格式输出
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok" --json

# 多账号(逗号分隔)
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --accounts "@tiktok,@khaby.lame" --download

# 指定每页作品数量(默认10,最多50)
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok" --count 20 --download

# 翻页查看更多作品
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok" --page 2

# 按日期范围筛选作品
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok" --date-start 2026-07-01 --date-end 2026-07-31

# 组合使用:第2页 + 日期过滤 + 下载
python3 "$SKILL_PATH/scripts/tiktok-home-downloader.py" --account "@tiktok" --page 2 --count 20 --date-start 2026-06-01 --download

Parameter description

Parameter Description
--account A single TikTok account (homepage link / secUserId)
--accounts Multiple TikTok accounts, separated by commas
--count Number of posts per page (default 10, maximum 50)
--page Page number (default 1)
--date-start Start date YYYY-MM-DD
--date-end End date YYYY-MM-DD
--download Download video files locally
--output-dir Download directory (default output/)
--json JSON format output
--rate-limit Request interval in seconds (default 1.0)
--api-key Specify API Key

Dependencies

Dependency Installation command
requests pip3 install requests

TikTok account input requirements

The post retrieval API queries via secUserId . The script supports three types of input and will parse them automatically:

  1. Homepage link(recommended): e.g. https://www.tiktok.com/@tiktok, the script will automatically parse the account identifier from the page
  2. @handle: e.g. @tiktok、@khaby.lame, i.e. the part after @ in the homepage link
  3. secUserId:MS4w A long string starting with , which can be used directly

Important: If the user only enters an account name (such as "甲亢哥" or "Khaby Lame") without providing a homepage link or handle, you must prompt:

"TikTok account names may have multiple duplicates. Please provide the exactTikTok homepage link(e.g. https://www.tiktok.com/@tiktok)或主页 in the URL handle(such as @tiktok) for precise querying."

handle is the part after @ in the TikTok account homepage link, not the Chinese nickname.

Note: If the user inputs a single video link (the link contains /video/), you need to prompt that this skill is used to extract all works from the account homepage; please change it to providing the account homepage link.

Important: If the secUserId entered by the user is incorrect (does not start with MS4w , is too short, or is incorrectly formatted), you must return the complete acquisition instructions from the "How to obtain secUserId" section to the user, guiding the user to re-obtain it using the method before querying again, and do not directly end with an error.

Important: If the user provides an ordinary homepage link (such as https://www.tiktok.com/@tiktok, and the link does not contain the sec_uid= parameter) or @handle, you must prompt the user:

"The share link needs to include the sec_uid=MS4w... parameter: please go to the account homepage in the mobile TikTok App → "Share" → "Copy link". A share link with the sec_uid parameter can be queried directly and has a higher success rate."

Reason: an ordinary homepage link / handle requires accessing the TikTok page to parse the account identifier, which may fail due to network restrictions or anti-scraping; a share link with the sec_uid=MS4w... parameter can be queried directly without accessing the page.


FAQ

Q: How do I obtain the API Key? A: Go to redfox.hk to register and obtain it.

Q: Do downloaded videos have a watermark? A: No watermark. The direct video link after parsing has had the TikTok watermark removed.

Q: Which account input formats are supported? A: Three are supported: ① Homepage link (such as https://www.tiktok.com/@tiktok); ② @handle (such as @tiktok);③ secUserId(MS4w long string).

Q: Why does homepage link parsing fail? A: TikTok pages in some regions have access restrictions or anti-scraping measures, and the script cannot extract the account identifier from the page. In this case, you can ask the account owner to "Share → Copy link" from the homepage and provide it again, or directly provide the secUserId.

Q: Why does it prompt "call frequency limit exceeded"? A: Requests were too fast and triggered rate limiting. You can increase --rate-limit 2.0 to extend the interval.

Q: Can image-text works be downloaded? A: Yes. Image-text works (photo type) will automatically download the first watermark-free image, in JPG/PNG/WebP format.