Download reels, shorts and videos from Facebook, Instagram, YouTube, TikTok and X with a share link.
rd https://www.facebook.com/share/r/<code>/
rd https://youtube.com/shorts/<id>
curl -fsSL https://raw.githubusercontent.com/alileza/rd/main/install.sh | sh
This installs the latest release for macOS or Linux (Intel or ARM) into /usr/local/bin. It asks for sudo only if that directory isn’t writable.
To install somewhere else, or to pin a version:
curl -fsSL https://raw.githubusercontent.com/alileza/rd/main/install.sh | RD_INSTALL_DIR="$HOME/.local/bin" sh
curl -fsSL https://raw.githubusercontent.com/alileza/rd/main/install.sh | RD_VERSION=v0.1.0 sh
With Go installed, you can also build from source:
go install github.com/alileza/rd/cmd/rd@latest
rd <url> # save to the current directory as <site>-<id>.mp4
rd -o ~/Downloads <url> # save into a directory
rd -o clip.mp4 <url> # save to a specific file
rd -audio <url> # save only the audio, as <site>-<id>.mp3
rd -o song.mp3 <url> # save only the audio, as MP3
rd -o song.m4a <url> # save only the audio, as AAC without re-encoding
rd -url <url> # print the direct media URL(s) without downloading
rd -version
Audio-only downloads work on every supported site and need ffmpeg on your PATH. MP3 is re-encoded at VBR quality 2 (about 190 kbps); M4A keeps the original AAC audio as is. Videos without sound (some Instagram posts, GIFs on X) stop with “has no audio track” instead of writing an empty file.
| Site | Links |
|---|---|
facebook.com/share/r/…, /reel/…, /videos/…, watch?v=…, fb.watch/… |
|
| YouTube | youtube.com/shorts/…, watch?v=…, /live/…, /embed/…, youtu.be/… |
| TikTok | tiktok.com/@user/video/…, vm.tiktok.com/…, vt.tiktok.com/… |
| X | x.com/<user>/status/…, twitter.com/<user>/status/… |
instagram.com/reel/…, /p/…, /<user>/reel/…, /share/… |
Only public posts work. Facebook serves the best progressive MP4 it offers to logged-out users, usually 720p.
Both regular YouTube videos and Shorts work, from any of the link forms above. YouTube only serves 360p as a single file; higher qualities come as separate video and audio streams. With ffmpeg on your PATH, rd downloads the best H.264 video (up to 1080p) and AAC audio and merges them without re-encoding. Without it, you get the 360p file. Some videos only let rd download the first part of their separate streams (YouTube wants a PO token that rd can’t make); for those you also get 360p, and audio comes from that file at the same quality. Age-restricted and members-only videos don’t work. With ffmpeg, -url prints two lines: the video stream, then the audio stream.
On TikTok, rd picks the highest-bitrate H.264 version of the video. Photo slideshows aren’t supported.
On X, rd saves the first video or GIF in the post (or in the post it quotes) at the highest bitrate offered, up to 1080p. Age-restricted and protected posts don’t work.
On Instagram, rd saves the progressive H.264 version of a public reel or video post (usually 720p), or the first video in a carousel. Instagram also offers 1080p, but only as VP9, which many players can’t handle. Private posts don’t work, and Instagram may ask for a login if you download a lot in a short time.
Each site is one file in extractor/. It implements Extractor and registers itself in init:
type Extractor interface {
Name() string
Match(u *url.URL) bool
Extract(ctx context.Context, c *http.Client, u *url.URL) (*Media, error)
}
See extractor/facebook.go for an example.
Pushing a v* tag builds the binaries and publishes a GitHub release that the installer picks up:
git tag v0.1.0 && git push origin v0.1.0