README.md

db597a03bc7a1786d5261e8a55628da30193c775
youtube-tui/README.md rendered · source · history · blame · raw

148 lines · 6886 bytes

  1![](https://img.shields.io/github/languages/top/siriusmart/youtube-tui?label=rust)
  2![](https://shields.io/github/license/siriusmart/youtube-tui)
  3[![](https://img.shields.io/crates/d/youtube-tui?label=crates.io%20downloads)](https://crates.io/crates/youtube-tui)
  4[![](https://img.shields.io/crates/v/youtube-tui?label=crates.io%20version)](https://crates.io/crates/youtube-tui)
  5![](https://shields.io/github/stars/siriusmart/youtube-tui?style=social)
  6
  7# YouTube TUI
  8
  9An aesthetically pleasing YouTube TUI written in Rust.
 10
 11> ## Warning
 12> 
 13> The current code on GitHub is a rewritten-from-scratch version of the old code, it is not functional yet. Therefore if you would like to try the TUI out, please install it from `crates.io` (seen Installation).
 14> 
 15> ### Changes
 16> 
 17> #### Framework
 18> Now uses the TUI framework from `tui-additions` which I wrote specifically for this project. The main benefits of this are that all "items" are no longer related to each other, so changing one of them won't break the others. This modular framework also make fixing bugs in existing items and adding new ones much easier (which is the main reason that I decided to rewrite the entire thing from scratch).
 19> 
 20> The main drawbacks of using a framework is there are limitations of what I can do (the old code does excatly what I wanted it to, but it's a hella mess), and the performance may take a hit (just slightly, TUIs written in Rust are still ***blazingly fast!!!***).
 21> 
 22> #### Config files readability
 23> 
 24> The old config files uses the YAML format, which is usually very easy to read, but when it comes to `tuples` and custom `struct` representation it actually look pure gibberish.
 25> 
 26> The new config files are also in YAML, but I prevented tuples from appearing in them by removing stuff nobody is gonna change anyways and options that are gonna break the entire thing anyways, so that even a 6 year old Roblox player would have the ability to read and modify their config.
 27> 
 28> No docs on the config until I finish the whole thing, so if you want to figure out stuff go read the code yourself it's not that bad now.
 29> 
 30> #### Sixels!
 31> 
 32> You can now display PNGs in terminal yay! Very slow and lots of delay, trying to get it work multithreaded so that it can still be usable but with no success. If anyone knows how to do that (or just make it faster) please help.
 33> 
 34> #### Code readability
 35> 
 36> The code is now more idiomatic and i put comments so yeah go read it and i will memorize the arch wiki
 37> 
 38> ### Progress
 39> 
 40> #### Done
 41> 
 42> - Config files (mostly, more options will be added when I get to that part)
 43> - Home page with its basic items
 44> 
 45> #### To do before release
 46> 
 47> - Search filters
 48> - All pages (search, video/playlist/channel info)
 49> - Basically back to where it is before the rewrite
 50
 51## Overview
 52YouTube TUI is a text user interface that provides a clean TUI for browsing YouTube. It can perform YouTube query searches, view and inspect channels, and play the desired content as a regular video or audio-only stream for saving bandwidth.
 53
 54
 55![Screenshot](https://cdn.discordapp.com/attachments/906941311142219816/990684947830419526/Screenshot_20220626_192433.png)
 56
 57## User manual
 58
 59[YouTube TUI user manual](https://siriusmart.github.io/youtube-tui)
 60
 61## Installation
 62
 63### Install from crates.io
 64
 65```bash
 66cargo install youtube-tui
 67```
 68
 69### Clone from GitHub and build
 70```bash
 71git clone https://github.com/sirusmart/youtube-tui && cd youtube-tui && cargo build --release
 72```
 73Once build, the compiled binary will be located at `./target/release/youtube-tui`. The program is not in your path yet, so you'll have to manually move to to a place from which you would be able to execute it. A common way to do so is to copy the binary executable to `/usr/local/bin/youtube-tui`. 
 74
 75> ### Dependencies
 76>
 77> This program does not requires any dependencies, but it is suggested these three things on your system that can be launched via command:
 78>
 79> 1. A video player (Defaults to `mpv`)
 80> 2. A terminal emulator (Defaults to `konsole`)
 81> 3. A YouTube downloader (Defaults to `yt-dlp`, strongly suggest NOT to use `youtube-dl` because it is now very slow)
 82>
 83> None of these dependencies are required as you can change them in config (in `commands.yml`)
 84
 85## Usage
 86
 87* A video player (Defaults to `MPV`)
 88* A terminal emulator (Defaults to `konsole`)
 89* A YouTube downloader (Defaults to `yt-dlp`, it is recommended that you do not use  `yt-dl`, as the download speeds are ludicrously slow)
 90
 91> None of these dependencies is required, and you can change the defaults in the config file `commands.yml`
 92
 93### Movement
 94
 95|Key|What does it do|
 96|---|---|
 97|Arrow/Vim keys|Move in the corresponding direction|
 98|Enter|Select/Launch|
 99|Q|Quit the program|
100
101Check the user manual [here](https://siriusmart.github.io/youtube-tui)
102
103> ### Note
104>
105> 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.
106
107### Config
108
109All config files are located at `~/.config/youtube-tui/`, will write documentation for that later
110
111## Known issues
112
113### Missing hash key: "selected"
114
115When viewing the playlists page in a channel, it gives you a `Missing hash key: "selected"`. This is because Invidious was not able to fetch the requested playlists.
116
117You should also see an error when visiting [this URL](https://vid.puffyan.us/api/v1/channels/UCAkuTH35kk3W1EL9vq6dj6A/playlists)
118
119Here's the [opened issue](https://github.com/iv-org/invidious/issues/3154)
120
121## Todo (First priority on top)
122
123* Go directly to a page by URL
124* Vim-like commands in the status bar
125* Save as local playlist/video
126* Command line launch options
127* Channel search and channel video sort
128* Recommended videos
129
130## Help needed
131
132Guys please I need help I'm kinda bad at coding tbh, so these are stuff that I need help with
133
134* Publishing to the AUR
135* Printing full resolution images to the terminal with Sixel
136
137## Credits
138
139* [ytfzf](https://github.com/pystardust/ytfzf) by [pystardust](https://github.com/pystardust) - The TUI I used to watch on YouTube, gave me an idea of how this program is going to work
140* [Terminal Typeracer](https://gitlab.com/ttyperacer/terminal-typeracer) by [Darrien Glasser](https://gitlab.com/DarrienG) - A very clean-looking TUI for typing speed test, gave me an idea of how this program should look like
141* [Invidious](https://invidious.io) - For having a nice API for doing YouTube searches and stuff. (I made a wrapper for the API you can check it [here](https://crates.io/crates/invidious) out if you want to)
142
143
144... and of course, credits to myself for not having the ability to read the docs for ytfzf and decided to make my own instead. 
145
146## Anything Missing?
147
148If there is a bug or you got a nice idea of what can be added to this program, feel free to open a GitHub issue. Thx :D