使用yt-dlp从社交媒体URL提取媒体(视频、照片、GIF、音频)。支持1872+平台,包括YouTube、TikTok、Instagram、X/Twitter、Facebook等。
⚠️ Security warnings before use:
--confirm-upload to upload to public third-party hosts (tmpfiles.org, transfer.sh)--cookies-from-browser) exposes active session tokens for any platform you're logged into⚠️ Before any extraction: Confirm the content is not private, paid, or sensitive. Files over 50 MB are uploaded to public temp hosts — the script now shows a pre-upload warning and supports --no-upload to skip it entirely.
bash
node skills/clip/extract.js <url> [options]
FlagDescription--output-dir <dir>Save location (default: /tmp/media-share)--titleReturn title/description only, no download--infoReturn full metadata as JSON--testValidate URL without downloading--uploadForce cloud upload even for small files--confirm-uploadRequired for any public cloud upload — explicit opt-in--cloud=<provider>Cloud provider: tmpfiles or transfer``--no-direct-sendAlways return path, never auto-send--no-uploadSkip cloud upload entirely — always return local path--list-sitesShow supported platforms--list-typesShow what media a URL contains
bash
# Download media (fastest path)
node skills/clip/extract.js "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Get title only (no download, instant)
node skills/clip/extract.js "https://www.instagram.com/p/abc123/" --title
# Check what's in a URL before downloading
node skills/clip/extract.js "https://www.tiktok.com/@user/video/123" --list-types
# Show supported sites
node skills/clip/extract.js --list-sites
yt-dlp: 1,872 extractors — covers essentially every major media platform on the internet.
YouTube, TikTok, Instagram, X/Twitter, Facebook, Reddit, Twitch, Vimeo, Dailymotion, Rumble, Peertube, Bilibili, Niconico, SoundCloud, Bandcamp, Pinterest, Imgur, Tumblr, Flickr, Bluesky, Telegram, Kick, Odysee, CNN, BBC, Al Jazeera, TED, Khan Academy, Udemy, Crunchyroll, HiDive, and 1,800+ more.
--confirm-upload to upload to temp cloud storage, returns download link--confirm-upload → Returns local path only, blocks upload with clear message--upload → Forces cloud upload even for smaller files (still requires --confirm-upload)⚠️ Both providers are public and third-party. Uploaded files are accessible to anyone with the link.
ProviderMax SizeNotestmpfiles50 MBSimple, no signup, auto-deletetransferUnlimitedtransfer.sh, 30-day retention
Pre-upload warning: Files over 50 MB require --confirm-upload for any public cloud upload. Without it, the script returns the local path only and blocks the upload with a clear message. Use --no-upload to always save locally without prompts.
⚠️ Browser cookie access exposes active session tokens for every platform you're logged into.
Some platforms require cookies for full access:
PlatformNeeds cookies?InstagramSometimes (private content, full resolution)X / TwitterSometimes (rate limits, some content)PatreonYes (paid content)OnlyFansYesFanvue / FanslyYesNetflix / HBO / Disney+Via browser cookiesYouTubeRarely (age-restricted content)
If cookies are needed:
--cookies-from-browser chrome as a last resort — it exposes ALL platform session tokens in that browser--cookies-from-browser with paid/sensitive platforms unless the user explicitly consents to the riskyt-dlp --dump-json detects the platform and media typeyt-dlp -o <path> grabs the highest quality versionyt-dlp (installed) — 1,872 extractorsffmpeg (installed) — format conversioncurl (installed) — cloud uploadsWhen a URL returns no media, the script returns the title/description. The agent should:
--cookies-from-browser chrome if the platform may require authgeneric extractor handles many embedded video players not explicitly listed