README ¶
invidtui
invidtui is an invidious client, which fetches data from invidious instances and displays a user interface in the terminal(TUI), and allows for selecting and playing Youtube audio and video.
Currently, it is tested on Linux and Windows, and it should work on MacOS.
Features
- Play audio or video
- Control the video resolution
- Ability to open, view, edit and save m3u8 playlists
- Automatically queries the invidious API and selects the best instance
- Search for and browse videos, playlists and channels, with history support
Requirements
- MPV
- Youtube-dl
- FFMpeg
Installation
You can install the package either via the following command:
go install github.com/darkhz/invidtui@latest
or check the Releases page and download the binary that matches your OS and architecture.
Usage
invidtui [<flags>]
Flags:
--close-instances Close all currently running instances.
--force-instance Force load media from specified invidious instance. (default "")
--mpv-path Specify path to the mpv executable. (default "mpv")
--num-retries Set the number of retries for connecting to the socket. (default 100)
--use-current-instance Use the current invidious instance to retrieve media.
--video-res Set the default video resolution. (default "720p")
--ytdl-path Specify path to youtube-dl executable or its forks (yt-dlp, yt-dtlp_x86) (default "youtube-dl")
-
The close-instances option should mainly be used if another invidtui instance may be using the socket, if there was an application crash, or if an error pops up like this:
Error: Socket exists at /home/test/.config/invidtui/socket, is another instance running?
. -
The use-current-instance option can be used in cases where a playlist file has to be loaded, but the URLs in the playlist point to a slow invidious instance. The playlist media can instead be retrieved from a fast instance (automatically selected by invidtui).
-
While specifying the force-instance option, it is recommended to input just the instance name, remove the "https://" prefix if present. If the instance url is not valid, invidtui will automatically choose another valid instance.
Configuration file
Generally, invidtui will work out-of-the-box, with no configuration required.
In case you need to specify settings without using command-line options, a config file can be used.
Typing invidtui --help
will show you the location of the config file.
Config file definitions are in the form of a simple name=value
or name value
pair.
For example:
video-res=720p
mpv-path=/home/user/mycustompath/mpv
ytdl-path=/home/user/mycustompath/ytdl
num-retries=10
use-current-instance
force-instance=invidious.snopyta.org
Keybindings
Search
/
Show search input. To search a channel from the main screen immediately instead of loading it first, press Alt+/.Ctrl + e
Switch between search modes (video, playlist, channel)
Playlist Queue
p
Open playlist queue. This control will work across all pages.Ctrl+o
Open saved playlist. This control will work across all pages.Ctrl+a
Append from a playlist file to the playlist queueCtrl+s
Save current playlist queueShift+m
Move an item in playlist queue. To cancel a move, just press Enter in the same position the move operation was started.d
Delete an item in playlist queue
Player
Note: These controls will work across all pages (search, playlist or channel pages)
Space
Pause/unpause=
Increase volume-
Decrease volumeRight
Seek forwardLeft
Seek backward<
Switch to previous track>
Switch to next tracks
Cycle shuffle mode (shuffle-playlist)m
Cycle mute model
Cycle repeat modes (repeat-file, repeat-playlist)Shift+s
Stop player
Application
Ctrl+Z
Suspendq
Quit
Page-based Keybindings
i
This control works on the search and channel playlist pages.
Fetches the Youtube playlist contents from the currently selected entry and displays it in a separate playlist page.
In case you have exited this page, you can come back to it by pressing Alt+i instead of reloading the playlist again.u
This control works on the search page.
Fetches only videos from a Youtube channel (from the currently selected entry) and displays it in a separate channel video page.
Shift+u fetches only playlists from a Youtube channel and displays it in a separate channel playlist page. In case you have exited
this page, you can come back to it by pressing Alt+u instead of reloading the channel again.Enter
This control works on the search, playlist, channel video and channel playlist pages.
Fetches more results.Tab
This control works on the channel video, channel playlist and channel search pages
Switches the channel page being shown./
This control works on the search and channel search pages.
Refer to the search keybindings above.a
This control works on the search, playlist and channel video list pages.
Fetches audio of the currently selected entry and adds it to the playlist.
If the selected entry is a playlist, all the playlist contents will be loaded into
the playlist queue as audio. To immediately play after adding to playlist, press Shift+a.v
This control works on the search, playlist and channel video pages
Fetches video of the currently selected entry and adds it to the playlist.
If the selected entry is a playlist, all the playlist contents will be loaded into
the playlist queue as video. To immediately play after adding to playlist, press Shift+v.Ctrl+x
Cancel the fetching of playlist or channel contents (in case it takes a long time,
due to slow network speeds for example).Esc
Exit the current page.
Additional Notes
-
Since Youtube video titles may have many unicode characters (emojis for example), it is recommended to install noto-fonts and its variants (noto-fonts-emoji for example). Refer to your distro's documentation on how to install them. On Arch Linux for instance, you can install the fonts using pacman:
pacman -S noto-fonts noto-fonts-emoji noto-fonts-extra
-
For the video mode, only MP4 videos will be played, and currently there is no way to modify this behavior. This will change in later versions.
-
On Windows, using invidtui in Powershell/CMD will work, but use Windows Terminal for best results.
-
For certain videos where the duration is shown as "00:00", but the published date is greater than 0s, it is most likely that the video is a live stream. Due to certain inconsistencies with the invidious API, such videos are not shown as live streams in the search results, but will show when playing.
-
Since invidtui relies on specially crafted URLs to load and display media properly, it is not recommended to edit the autogenerated playlist.
Documentation ¶
There is no documentation for this package.