agentleFS
TikHubTikHub/tikhub-plugin/skills/social-media-downloader/SKILL.md

social-media-downloader

Skill7 starsChanged 5 months agoMITView on GitHub

Download video, audio, or images (no-watermark where available) from a social-media URL or list of URLs. Use when the user pastes a TikTok/Douyin/Instagram/YouTube/Twitter/Xiaohongshu link and wants the media file, or says "download this video", "save without watermark", "grab the audio". Dispatches to the right per-platform TikHub endpoint.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not an auth/credit error.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Social Media Downloader

Turn a post URL into a saved media file by routing it to the correct platform endpoint, extracting the media URL from the response, and downloading it.

Setup gate

[ -z "${TIKHUB_API_KEY:-}" ] && echo "Set TIKHUB_API_KEY first (see tikhub-onboarding)."

Step 1 — Detect the platform from the URL and pick the endpoint

PlatformEndpointInputMedia field
TikTokGET /api/v1/tiktok/app/v3/fetch_one_video_by_share_urlshare_urlno-watermark play_addr / download_addr url_list
TikTok (by id)GET /api/v1/tiktok/app/v3/fetch_one_videoaweme_idurl_list
DouyinGET /api/v1/douyin/app/v3/fetch_one_video_by_share_urlshare_urlvideo url_list
Douyin (by id)GET /api/v1/douyin/app/v3/fetch_one_video_v2aweme_idvideo url_list
YouTubeGET /api/v1/youtube/web_v2/get_video_streams_v2video_id | video_urlstream URLs (pick resolution)
InstagramGET /api/v1/instagram/v2/fetch_post_infocode_or_urlmedia URL(s)
XiaohongshuGET /api/v1/xiaohongshu/app_v2/get_video_note_detail (video) / get_image_note_detail (images)note_idvideo / image URLs
Twitter/XGET /api/v1/twitter/web/fetch_tweet_detailtweet_idmedia url_list

For TikTok/Douyin, the *_by_share_url endpoints take the raw URL directly — no need to extract an id. For the others, pull the id/code from the URL (or resolve it via the platform skill).

Step 2 — Call the endpoint

# TikTok by share URL (simplest — pass the URL straight through)
URL="https://www.tiktok.com/@nasa/video/7650608519288245534"
curl -s "https://api.tikhub.io/api/v1/tiktok/app/v3/fetch_one_video_by_share_url?share_url=$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1],safe=''))" "$URL")" \
  -H "Authorization: Bearer $TIKHUB_API_KEY" -o /tmp/media.json

# YouTube streams
curl -s "https://api.tikhub.io/api/v1/youtube/web_v2/get_video_streams_v2?video_id=dQw4w9WgXcQ" \
  -H "Authorization: Bearer $TIKHUB_API_KEY" -o /tmp/media.json

Step 3 — Extract the media URL, then download

Parse the response for the highest-quality (no-watermark, for TikTok/Douyin) media URL — usually a url_list array or a stream URL — then save it:

curl -L "<media_url_from_response>" -o video.mp4
file video.mp4   # confirm it's a real media container

Batch downloads

Loop over a URL list, one at a time with a small delay (respect QPS 10/sec). Each parse is one billed call — warn the user for large batches and hand off to bulk-data-export for big jobs.

Verification gate

  1. Response is code: 200 and contains a non-empty media URL.
  2. Downloaded file is non-empty and the expected type (file video.mp4 shows a video container).
  3. Not an auth/credit error.

Red flags

  • Claiming a download succeeded without checking the file is non-empty/valid.
  • Using the wrong platform endpoint for a URL — detect the platform first.
  • Unbounded batch loops (credit burn + rate limits).
  • Re-hosting/redistributing copyrighted media — respect platform ToS and the user's rights.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.