ytsub
ytsub is a subscriptions only tui youtube client.
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.
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
# or
Arch Linux
ytsub is available in the AUR as
stable source package,
stable binary package and
latest development package.
You can install it using your preferred AUR helper.
# stable source package
# stable binary package
# latest development package
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
For default key bindings, press ctrl-h in the app or refer to
the example config.toml file.
Subscribing
Pressing i prompts the user to enter a channel id or url.
Example inputs
UCsXVk37bltHxD1rDPwtNM8Qhttps://youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q<INVIDIOUS_INSTANCE>/channel/UCsXVk37bltHxD1rDPwtNM8Q@kurzgesagthttps://youtube.com/@kurzgesagt
Configuration
Default directory of the configuration files is $HOME/.config/ytsub.
| File | Description |
|---|---|
config.toml |
option, key binding and theme configurations |
instances |
list of invidious instances |
config.toml
Path to the configuration file can be specified with the -c flag.
Example config.toml with default values
# Options
= "/home/username/.local/share/ytsub/videos.db" # Path to database file
= "/home/username/.config/ytsub/instances" # Path to instances file
= ["videos"] # Tabs to fetch videos from [possible values: videos, shorts, streams]
= true # Hide available tabs in the ui if they are not in the `tabs` option
= "local" # API to be used for fetching videos [possible values: invidious, local]
= 600 # Time in seconds that needs to pass before refreshing a channel using the refresh_channels command
= 9999 # Use RSS if the number of channels being refreshed or being subscribed to exceeds the specified amount
= 10 # Tick rate in milliseconds
= 5 # Request timeout in seconds
= "" # Symbol to highlight selected items
= false # Hide watched videos by default
= false # Hide members only videos
= true # Show video thumbnails in the video info area
= "top" # Position of the video info area [possible values: top, bottom]
= true # If `false`, shown only when there isn't enough space for all columns. Ignored if `show_thumbnails` is `true`
= "mpv" # Video player to use to play streams [possible values: mpv, vlc]
= "mpv" # Path to mpv
= "vlc" # Path to vlc
# the options below apply only while playing stream formats
= [] # Subtitle languages to add
= true # Use adaptive formats
= true # Use original video titles
= true # Use original audio tracks
= "best" # Preferred video quality
# the commented out options below are `None` by default
# preferred_video_codec = "webm" # [possible values: webm, mp4]
# preferred_audio_codec = "webm"
= true # Get chapter information of videos
# Theme
# fg and bg fields can be set with rgb (ex: "255, 255, 255"),
# hex (ex: "#ffffff") or named colors.
# Valid color names are Black, Red, Green, Yellow, Blue, Magenta
# Cyan, Gray, DarkGray, LightRed, LightGreen, LightGreen,
# LightYellow, LightBlue, LightMagenta, LightCyan, White and Reset.
# Valid modifiers are bold, dim, italic, underlined,
# slow_blink, rapid_blink, reversed, hidden and crossed_out.
# Example:
# [title]
# fg = "#123456"
# bg = "10, 250, 99"
# modifiers = "bold reversed italic"
# Example with alternative syntax:
# title = { fg = "#123456", bg = "10, 250, 99", modifiers = "bold reversed italic" }
# Block titles
[]
= "Cyan"
= "bold"
# Channel, Title, Length and Date headers
[]
= "Yellow"
= "bold"
# Selected item in inactive block
[]
= "Blue"
= "bold"
# Selected item in active block
[]
= "Magenta"
= "bold"
# Watched videos
[]
= "DarkGray"
# Selected watched video in inactive block
# Overrides the modifiers of [selected]. If fg and bg are set, they are patched to [selected]
[]
# Selected watched video in active block
# Overrides the modifiers of [focused]. If fg and bg are set, they are patched to [focused]
[]
# New video indicator
[]
= "Red"
= "italic"
# Members only video indicator
[]
= "Green"
= "italic"
# Border of selected block
[]
= "Magenta"
# Video info fields
[]
= "Green"
# Error message
[]
= "Red"
# Warning message
[]
= "Yellow"
# Key bindings in the help window
[]
= "Green"
# Key Bindings
# Valid key codes are backspace, space, enter, left, right, up, down, home, end
# pageup, pagedown, tab, backtab, del, delete, insert, esc, escape and characters.
# Valid modifiers are ctrl, shift and alt.
# Multiple key bindings can be set in a single line.
# Example: "escape q ctrl-c" = "quit"
# A default binding can be removed by setting it to an empty string.
# Example: "q" = ""
[]
= "set_mode_subs" # Switch to subscriptions mode
= "set_mode_latest_videos" # Switch to latest videos mode
= "on_down" # Go one line downward
= "on_up" # Go one line upward
= "on_left" # Switch to channels block
= "on_right" # Switch to videos block
= "select_first" # Jump to the first line in the list
= "select_last" # Jump to the last line in the list
= "next_tab" # Select next video tab
= "previous_tab" # Select previous video tab
= "jump_to_channel" # Jump to the channel of the selected video from latest videos mode
= "toggle_hide" # Hide/unhide watched videos
= "subscribe" # Enter editing mode to enter channel id or url
= "unsubscribe" # Open confirmation window to unsubcribe from the selected channel
= "delete_video" # Delete the selected video from database
= "search_forward" # Enter editing mode to make a forward search
= "search_backward" # Enter editing mode to make a backward search
= "repeat_last_search" # Search with the latest pattern and direction
= "repeat_last_search_opposite" # Search with the latest pattern and opposite direction
= "switch_api" # Switch between the available APIs
= "refresh_channel" # Refresh videos of the selected channel
= "refresh_channels" # Refresh videos of every channel
= "load_more_videos" # Load more videos for the selected channel
= "load_all_videos" # Load all videos for the selected channel
= "refresh_failed_channels" # Refresh videos of channels which their latest refresh was a failure
= "open_in_youtube" # Open channel or video Youtube page in browser
= "open_in_invidious" # Open channel or video Invidious page in browser
= "play_from_formats" # Play selected video in a video player using stream formats
= "play_using_ytdlp" # Play selected video in mpv using yt-dlp
= "select_formats" # Toggle format selection window
= "toggle_watched" # Mark/unmark selected video as watched
= "toggle_help" # Toggle help window
= "toggle_tag" # Toggle tag window
= "quit" # Quit application
[]
= "scroll_up" #general "on_up" binding also applies
= "scroll_down" # general "on_down" binding also applies
= "go_to_top" # general "select_first" binding also applies
= "go_to_bottom" # general "select_last" binding also applies
= "abort"
[]
= "toggle_selection" # Select/Unselect channel
= "select_all" # Select all channels
= "deselect_all" # Deselect all channels
= "import" # Import selected channels
[]
= "create_tag"
= "delete_tag"
= "rename_tag"
= "select_channels" # Pick channels for the tag
= "toggle_selection" # Select/Unselect tag
= "select_all" # Select all tags
= "deselect_all" # Deselect all tags
= "abort" # Close window
[]
= "confirm" # Confirm the selection of channels
= "abort" # Drop changes
= "toggle_selection" # Select/Unselect channel
= "select_all" # Select all channels
= "deselect_all" # Deselect all channels
[]
= "play_video"
= "abort"
= "select"
= "next_tab"
= "previous_tab"
= "switch_format_type"
instances
[!NOTE] At the time of writing, there are no suitable instances available on https://api.invidious.io, and they've rarely been available for quite a while now.
A custom path to the instances file can be specified with the -i flag.
The file can either be manually created by adding instances that have API enabled or
automatically generated from the instances in https://api.invidious.io by running the app with -g flag.
Every instance entry is separated by a line.
If the instances file doesn't exist, instances list will be built from https://api.invidious.io when
Invidious is selected as the API (as opposed to the local API).
Example instances file
https://vid.puffyan.us
https://invidio.xamh.de
https://inv.riverside.rocks
https://yt.artemislena.eu