#cli #terminal #youtube #tui

bin+lib youtube-tui

An aesthetically pleasing YouTube TUI written in Rust

6 releases (3 breaking)

Uses new Rust 2021

new 0.4.1 Jun 29, 2022
0.4.0 Jun 26, 2022
0.3.1 Jun 23, 2022
0.2.0 Jun 1, 2022
0.1.0 May 28, 2022

#122 in Command-line interface

Download history 48/week @ 2022-05-27 51/week @ 2022-06-03 7/week @ 2022-06-10 15/week @ 2022-06-17 68/week @ 2022-06-24

149 downloads per month

GPL-3.0 license

185KB
4.5K SLoC

YouTube TUI

An aesthetically pleasing pleasing YouTube TUI written in Rust.

Overview

YouTube TUI is a text user interface that provides a clean UI for browsing YouTube content. It can perform searches and view channels in the terminal, play videos and playlists with external programs like MPV. Rust is used in writing this program for its better performance and ease of maintaining.

This program is being actively developed and there will be new features coming up every commit.

Screenshot

What's new in this commit

  • Fixed text list not scrolling with cursor bug (where the cursor just goes out of the screen)
  • Improvements to the render() method

Installation

Install from crates.io

cargo install youtube-tui

Clone from GitHub and build

git clone https://github.com/sirusmart/youtube-tui && cd youtube-tui && cargo build --release

The binary is located at ./target/release/youtube-tui, go move it to other locations so that you can launch the program with youtube-tui command.

Dependencies

This program does not requires any dependencies, but it is suggested these three things on your system that can be launched via command:

  1. A video player (Default to mpv)
  2. A terminal emulator (Defaults to konsole)
  3. A YouTube downloader (Defaults to yt-dlp, strongly suggest NOT to use youtube-dl because it is now very slow)

None of these dependencies are required as you can change them in config (in commands.yml)

Usage

To launch

youtube-tui # or path to the binary

Movement

Key What does it do
Arrow/Vim keys Move in corresponding direction
Right arrow Move cursor right
Enter Select/Launch
Q Quit the program

Note

These keys only work when nothing is selected. When something is selected, your key presses are passed directly to the "object" you've selected. Press escape (Esc) if you want to deselect.

Config

All config files are loacted at ~/.config/youtube-tui/, will write documentations for that later

Known issues

Missing hash key: "selected"

When viewing the playlists page in a channel, it gives you Missing hash key: "selected". This is because Invidious was not able to fetch the requested playlists.

You should also see an error when visiting this URL

Here's the opened issue

Todo (First piority on top)

  • Put hard coded options into config files
  • User manual + documentations
  • Go directly to a page by URL
  • Vim-like commands in status bar
  • Command line launch options
  • Channel search and channel video sort
  • Recommended videos

Help needed

Guys please I need help I'm kinda bad at coding tbh, these are stuff that I need help with

  • Publishing to the AUR
  • Printing full resolution images to the terminal with Sixels

Credits

  • ytfzf by pystardust - The TUI I used to watch YouTube, gave me an idea how this program is going to work
  • Terminal Typeracer by Darrien Glasser - A very clean looking TUI for typing speed test, gave me idea on how this program should look like
  • Invidious - For having a nice API for doing YouTube searches and stuff. (I made a wrapper for the API you can check it here out if you want to)

... and of course, credits to myself for not having the ability to read the docs for ytfzf and decided to make my own instead.

Anything Missing?

If there is a bug or you got a nice idea on what can be added to this program, feel free to open a GitHub issue. Thx :D

Dependencies

~14–24MB
~429K SLoC