360 Secure SkillHub
360 安全技能中心

tiktok-downloader

该 Skill 提供下载 TikTok 视频的流程:用本地 shell 脚本下载单个视频,或用 yt-dlp 批量下载 URL 列表,并通过浏览器 Cookie 目录、User-Agent 与 Referer 头绕过 403 与登录限制。需网络访问,未包含视频剪辑、格式转换或图形界面。

kgc-yj
kgc-yj
热度 80.32
最近更新 2026-05-18 11:17:52
分类:自动化依赖:代码执行 / 联网浏览搜索 / 读写文件应用场景:社交媒体 / 自动化脚本 / 工作流 / 视频编辑

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add tiktok-downloader
Metadata
name
tiktok-downloader
description
Download TikTok videos by URL or hashtag. Handles 403 errors, cookies, and user-agent rotation. Use for downloading TikTok videos, batch downloading from a list of URLs, or saving TikTok content for offline use.

TikTok Downloader

This skill provides a robust workflow for downloading TikTok videos, overcoming common anti-bot measures like 403 Forbidden errors and login requirements.

Core Workflow

1. Single Video Download

To download a specific TikTok video, use the provided script:

/home/ubuntu/skills/tiktok-downloader/scripts/download_tiktok.sh <VIDEO_URL> [OUTPUT_DIR]

2. Handling 403 Forbidden Errors

If yt-dlp fails with a 403 error, follow these steps:

  1. Navigate to the URL using the browser tool to establish a session and cookies.
  2. Run the script again. It is pre-configured to extract cookies from the browser's data directory (/home/ubuntu/.browser_data_dir).

3. Batch Downloading

For multiple videos:

  1. Save all URLs to a text file (e.g., urls.txt).
  2. Use yt-dlp with the following recommended flags:
    yt-dlp --no-warnings \
      --cookies-from-browser "chromium:/home/ubuntu/.browser_data_dir" \
      --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" \
      --add-header "Referer:https://www.tiktok.com/" \
      -o "%(uploader)s - %(title).80s.%(ext)s" \
      --batch-file urls.txt
    

Best Practices

  • Browser Navigation: Always visit at least one TikTok video page in the browser before starting a batch download to ensure cookies are fresh.
  • Hashtag Pages: TikTok hashtag pages often require login. If a hashtag page fails to load, ask the user to log in via the browser or search for individual video URLs using the search tool.
  • Output Naming: Use %(uploader)s - %(title).80s.%(ext)s to keep filenames organized and avoid filesystem length limits.
  • Rate Limiting: For large batches, add sleep between downloads to avoid IP bans.