Skip to content

Stan-breaks/ytsurf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ytsurf

YouTube in your terminal. Clean and distraction-free.

Join our Discord

demo

✨ Features

  • Syncplay support – watch videos together in sync
  • Audio-only playback & downloads
  • Download videos or audio
  • Interactive format/quality selection when playing or downloading
  • External config file
  • Playback history and quick re-play
  • Adjustable search result limit
  • Custom download directory
  • Self-update (--update) for manual installations only
  • Copy short YouTube URLs to clipboard or print them
  • Channel subscriptions with a personalized feed
Selector Features Best For
fzf (default) Terminal-based, thumbnail previews, lightweight Most users (fast + previews)
rofi GUI menu, keyboard-driven, clean look Users who prefer a graphical menu
sentaku Very minimal, no previews Systems without Go/fzf support

πŸ“¦ Installation

Arch Linux (AUR)

yay -S ytsurf
# or
paru -S ytsurf

Homebrew

brew tap stan-breaks/ytsurf https://github.com/stan-breaks/ytsurf
brew install stan-breaks/ytsurf/ytsurf

Manual Installation

mkdir -p ~/.local/bin
curl -o ~/.local/bin/ytsurf https://raw.githubusercontent.com/Stan-breaks/ytsurf/main/ytsurf.sh
chmod +x ~/.local/bin/ytsurf

Make sure ~/.local/bin is in your PATH.

πŸ”§ Dependencies

  • Required: bash, yt-dlp, jq, curl, mpv, fzf, chafa, ffmpeg
  • Optional: rofi, sentaku, syncplay

Arch Linux install:

sudo pacman -S yt-dlp jq curl mpv fzf chafa rofi ffmpeg

πŸš€ Usage

USAGE:
  ytsurf [OPTIONS] [QUERY]

OPTIONS:
  --audio         Play/download audio-only version
  --download      Download instead of playing
  --format        Interactively choose format/resolution
  --rofi          Use rofi instead of fzf for menus
  --syncplay      Watch youtube with friend from the terminal
  --subscribe, -s Add a channel to the subs.txt
  --feed,-F       View videos from your feed
  --sentaku       Use sentaku instead of fzf or rofi(for system that can't compile go)
  --history       Show and replay from viewing history
  --limit <N>     Limit number of search results (default: in the config)
  --edit, -e      edit the configuration file
  --help, -h      Show this help message
  --version       Show version info
  --copy-url      Copy or display the video link

EXAMPLES:
  ytsurf lo-fi study mix
  ytsurf --audio orchestral soundtrack
  ytsurf --download --format jazz piano
  ytsurf --history

Run ytsurf without arguments to enter interactive mode.

βš™οΈ Configuration

Defaults check for default config in ~/.config/ytsurf/config. CLI flags always override config values.

Example config:

# ~/.config/ytsurf/config

# Set a higher default search limit
limit=25

# Always use audio-only mode
audio_only=true

# Set a custom download directory
download_dir="$HOME/Videos/YouTube"

πŸ› οΈ Troubleshooting

MPV doesn't play the selected video

Some systems have mpv configured to prefer youtube-dl instead of yt-dlp, which causes ytsurf to show β€œplaying…” without actually starting playback.

Fix: Rename your yt-dlp binary so that MPV uses it automatically:

sudo mv /usr/bin/yt-dlp /usr/bin/youtube-dl

Or create a symlink instead (safer):

sudo ln -s /usr/bin/yt-dlp /usr/local/bin/youtube-dl

MPV will now correctly pick up yt-dlp for streaming.

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md. Check out FUTURE_FEATURES.md for upcoming ideas.

πŸ“œ License

Released under the GNU General Public License v3.0.

⭐ Star History

Star History Chart

About

YouTube in your terminal. Clean and distraction-free.

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 6