YTSUB(1)

NAME

ytsubA subscriptions only TUI YouTube client

SYNOPSIS

$cargo install ytsub

INFO

81 stars
5 forks
0 views

DESCRIPTION

A subscriptions only TUI YouTube client

README

ytsub

ytsub is a subscriptions only tui youtube client.

demo

Dependencies

mpv and yt-dlp are optional dependencies for video playback. yt-dlp is not needed for playback when using the play_from_formats command.

ueberzugpp and chafa are optional dependencies for thumbnail support when the terminal does not provide a native graphics protocol.

xclip, xsel, wl-clipboard and wayclip are optional dependencies for clipboard support on Linux.

sqlite is a required dependency. If it is not available on the system, it can be compiled and linked by enabling the bundled_sqlite feature when building with cargo:

cargo build --features bundled_sqlite

Installation

Cargo

cargo install ytsub --locked

or

cargo install ytsub --features bundled_sqlite --locked

Arch Linux

ytsub, ytsub-bin and ytsub-git packages are available in the AUR. You can install one of them using your preferred AUR helper.

# stable source package
paru -S ytsub

stable binary package

paru -S ytsub-bin

latest development package

paru -S ytsub-git

Nix Flake

You can install the latest development version from GitHub using the flake:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    ytsub.url = "github:sarowish/ytsub";
  };

outputs = { nixpkgs, ytsub, ... }: { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ({ pkgs, ... }: { environment.systemPackages = [ ytsub.packages.${pkgs.system}.default ]; }) ]; }; }; }

If you want a specific release instead, pin the flake to a tag or commit.

Cache

The flake build workflow publishes builds to ytsub.cachix.org. Adding that cache to nix.settings lets Nix reuse pre-built binaries instead of compiling ytsub itself:

{
  nix.settings = {
    extra-substituters = [ "https://ytsub.cachix.org" ];
    extra-trusted-public-keys = [
      "ytsub.cachix.org-1:+//b4AUWp/46hIbTHVLhCU+DIP7TowiUWzM6Hsn8Ryg="
    ];
  };
}

Prebuilt Binaries

Prebuilt binaries for tagged releases are available on the GitHub releases page.

Download the archive for your platform, extract it, and place the binary somewhere in your PATH.

Usage

Usage: ytsub [OPTIONS] [COMMAND]

Commands: import Import subscriptions export Export subscriptions help Print this message or the help of the given subcommand(s)

Options: -c, --config <FILE> Path to configuration file -n, --no-config Ignore configuration file -d, --database <FILE> Path to database file -s, --instances <FILE> Path to instances file -g, --gen-instances Generate Invidious instances file -h, --help Print help -V, --version Print version

Managing subscriptions

Subscribing

Pressing i prompts the user to enter a channel id or url.

Example inputs
  • UCsXVk37bltHxD1rDPwtNM8Q
  • https://youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q
  • <INVIDIOUS_INSTANCE>/channel/UCsXVk37bltHxD1rDPwtNM8Q
  • @kurzgesagt
  • https://youtube.com/@kurzgesagt

Importing subscriptions

Subscriptions can be imported with:

ytsub import [--format FORMAT] <FILE>

Supported formats are:

  • youtube_csv (default) for YouTube subscription exports
  • newpipe for NewPipe subscription exports
From YouTube / Google Takeout
  1. Go to Google Takeout.
  2. Sign in if prompted.
  3. Under Create a New Export, make sure YouTube and YouTube Music is selected.
  4. Click All YouTube data included.
  5. Click Deselect all, then enable only subscriptions and click OK.
  6. Click Next step, then Create export.
  7. Download the generated .zip file when it is ready.
  8. Extract the archive and locate Takeout/YouTube and YouTube Music/subscriptions/subscriptions.csv (the directory and file names may differ depending on your language settings).
  9. Import the extracted CSV with:
ytsub import "Takeout/YouTube and YouTube Music/subscriptions/subscriptions.csv"
From NewPipe
  1. In NewPipe, go to the subscriptions page.
  2. Tap the three-dot menu in the top-right corner, then choose Export to, then File.
  3. Transfer the exported file to the device where you use ytsub.
  4. Import it with:
ytsub import --format newpipe <newpipe-subscriptions-file>

Key Bindings

The table below lists the default general key bindings.

Press ctrl-h in the app to open the binding help window. Window-specific bindings are shown as inline help in popup windows.

CommandDescriptionDefault keys
set_mode_subsSwitch to subscriptions mode1
set_mode_latest_videosSwitch to latest videos mode2
on_downMove one line downwardj, down
on_upMove one line upwardk, up
on_leftSwitch to channels blockh, left
on_rightSwitch to videos blockl, right
select_firstJump to the first lineg
select_lastJump to the last lineG
page_upMove up one pagectrl-b
page_downMove down one pagectrl-f
half_page_upMove up half a pagectrl-u
half_page_downMove down half a pagectrl-d
next_tabSelect next tabL
previous_tabSelect previous tabH
jump_to_channelJump to the channel of the selected video from latest videos modec
toggle_hideHide/unhide watched videost
subscribeSubscribei
unsubscribeUnsubscribed
delete_videoDelete the selected video from databaseD
search_forwardSearch Forward/
search_backwardSearch backward?
repeat_last_searchRepeat last searchn
repeat_last_search_oppositeRepeat last search in the opposite directionN
switch_apiSwitch APIs
refresh_channelRefresh videos of the selected channelr
refresh_channelsRefresh videos of every channelR
refresh_failed_channelsRefresh videos of channels which their latest refresh was a failureF
load_more_videosLoad more videosJ
load_all_videosLoad all videosctrl-j
copy_youtube_linkCopy channel or video Youtube link to clipboardy
copy_invidious_linkCopy channel or video Invidious link to clipboardY
open_in_youtubeOpen channel or video Youtube page in browsero
open_in_invidiousOpen channel or video Invidious page in browserO
play_from_formatsPlay video in video player using stream formatsp
play_using_ytdlpPlay video in mpv using yt-dlpP
select_formatsToggle format selection windowf
toggle_watchedMark/unmark video as watchedm
toggle_helpToggle help windowctrl-h
toggle_tagToggle tag selection windowT
quitQuit applicationq, ctrl-c

To configure the key bindings, see the key bindings section in the configuration documentation.

Thumbnails

Video thumbnails can be displayed inside the video info area. The rendering method is selected automatically based on terminal support and the availability of external tools.

Supported native graphics protocols are Sixel, Inline Images Protocol and Kitty Graphics Protocol. Support is detected using terminal queries, while environment variables are also used as hints when choosing a protocol.

Terminal cell size is detected from terminal responses when available and otherwise derived from the window size. If no native graphics protocol is available, rendering falls back to ueberzugpp, then chafa, and finally an internal half-block renderer that uses Unicode half-block symbols.

Downloaded thumbnails are cached under the ytsub cache directory in thumbnail/ (for example ~/.cache/ytsub/thumbnail on Linux).

Tested Terminal Emulators

TerminalProtocolWorksNotes
kittyKitty Graphics Protocol✔️-
GhosttyKitty Graphics Protocol✔️-
footSixel✔️-
ContourSixel✔️-
xtermSixel✔️Launch with -ti 340 to make sure sixel support is enabled.
BlackBoxSixel✔️Requires Sixel support at compilation and in preferences.
Windows TerminalSixel✔️-
WezTermInline Images Protocol✔️Also supports Sixel, but images seem to be misplaced sometimes.
RioInline Images Protocol✔️Also supports Sixel.
WarpInline Images Protocol✔️-
mltermInline Images Protocol✔️Also supports Sixel.
TabbyInline Images Protocol✔️Also supports Sixel.
BobcatInline Images Protocol✔️Also supports Sixel. Inline Images option should be enabled.
KonsoleSixelAlso supports iip. Images aren't cleared properly.
VSCodeSixelAlso supports iip. Images aren't cleared properly.
ctxSixel-

tmux

To make thumbnail rendering work correctly in tmux, add the following options to your tmux.conf:

set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM

Then restart tmux:

tmux kill-server && tmux || tmux

Clipboard

For clipboard support, one of the following providers is used if available:

  • Wayland: wl-clipboard or wayclip
  • X11: xclip or xsel
  • macOS: pbcopy
  • Windows: native clipboard API

If no clipboard provider is available, or if invoking the clipboard provider fails, ytsub falls back to OSC52 for copying.

[!WARNING] OSC52 capability is queried through DA1 and XTGETTCAP, but some terminals do not report it despite supporting it. Because of this, OSC52 sequences are sent regardless of detection.

The status message after pressing y or Y is one of:

  • Copied: {link}
  • OSC52 copy sent: {link}

The second message is shown when support could not be confirmed. This means an OSC52 copy sequence was sent, but actual copying may not occur.

Configuration

By default, config.toml and the instances file are read from $HOME/.config/ytsub.

You can change the config.toml path with the -c flag and the instances file path with the -s flag.

If no config.toml is found, ytsub starts with built-in defaults.

See the configuration documentation for details.

SEE ALSO

clihub5/2/2026YTSUB(1)