Commit 556d9ef612

556d9ef612a5a7a5274d1e8129a730c3d56e0c3d

parent: 9846b1a18e

Unsigned

Siriusmart <71584876+Siriusmart@users.noreply.github.com> · 2023-07-16 15:15 UTC

0.7.4

Layout: unified · split

docs/src/SUMMARY.md +1
@@ -3,6 +3,7 @@
3- [Overview](README.md) 3- [Overview](README.md)
4- [Installation](installation.md) 4- [Installation](installation.md)
5- [Basic usage](basic_usage.md) 5- [Basic usage](basic_usage.md)
6- [Invidious](invidious.md)
6- [Commands](commands.md) 7- [Commands](commands.md)
7 8
8# Customisation guide 9# Customisation guide
docs/src/changelogs.md +9 −6
@@ -1,23 +1,26 @@
1# Changelogs 1# Changelogs
2 2
3### v0.7.4 (latest unstable on git) 3## v0.7.4 (latest stable on crates.io)
4 4
5#### Added 5### Added
6 6
7- `Ctrl + w` and `Ctrl + u` in search bar and command mode. 7- `Ctrl + w` and `Ctrl + u` in search bar and command mode.
8- Keybindings works even when an item is selected (`legacy_input_handling: false` in `main.yml`). 8- Keybindings works even when an item is selected (`legacy_input_handling: false` in `main.yml`).
9- Creating fake key input using `:key`
9 10
10#### Fixed 11### Fixed
11 12
12- Search filters popup closing when you click on it. 13- Search filters popup closing when you click on it.
14- Configured keybindings in all items.
15- Fixed multiple issues in [#35](https://github.com/Siriusmart/youtube-tui/issues/35)
13 16
14## v0.7.3 (latest stable on crates.io) 17### v0.7.3
15 18
16### Added 19#### Added
17 20
18- Lazy feed syncing (configurable), so you are not actively ddosing the Invidious instance as badly. 21- Lazy feed syncing (configurable), so you are not actively ddosing the Invidious instance as badly.
19 22
20### Fixed 23#### Fixed
21 24
22- Search bar no longer shows escaped search query: the original text string is displayed instead. 25- Search bar no longer shows escaped search query: the original text string is displayed instead.
23- Fixed something about labeling channels with * although no new video is published. 26- Fixed something about labeling channels with * although no new video is published.
docs/src/invidious.md added +29
@@ -0,0 +1,29 @@
1# Invidious
2
3Invidious is a free and open-source alternative frontend to YouTube. It is intended to be used as a lightweight and "privacy-respecting" alternative to the official YouTube website.
4
5## How Invidious is used in youtube-tui
6
7The TUI does not access YouTube using its official API, instead it uses the Invidious API to access videos - since it is much easier to use and does not require users to be logged using their API token.
8
9By sending a request to one of their [API paths](https://docs.invidious.io/api/), it returns a JSON response containing information about videos, playlists, channels which can be understood by the program.
10
11## YouTube is blocking Invidious
12
13Referencing to [this GitHub issue](https://github.com/iv-org/invidious/issues/3822), YouTube has started trying to block public Invidious instances. So far some Invidious instances are blocked from accessing video information, the TUI displays an error when that happens, which may happen more and more frequently, and to more instances.
14
15There are several ways to bypass this.
16
17### Use smaller, or private instances
18
19All public instances can be found in [api.invidious.io](https://api.invidious.io/), it is likely there are instances on the list which are not blocked from accessing YouTube videos. Change your `invidious_instance` option in [`main.yml`](./config/main.md) to the new instance address.
20
21If you know people who host their own websites and services, it is possible that they already have their own private Invidious instance running. If that's not the case, try asking nicely for them to host an Invidious instance, it might work. (Stop being the introvert you are, go touch some grass and talk to humans)
22
23### Self host a local instance
24
25[Here](https://docs.invidious.io/installation/)'s the official installation guide, and [here](https://github.com/tmiland/Invidious-Updater)'s a cool install script.
26
27> Note: the install script is a bit buggy and does not prompt you to press `y`, so it may appear that it is hanging. For that you can just look into `invidious_installer.log` to see if you are supposed to press `y`.
28
29No more info for now.
src/config/commandbindings.rs +19 −3
@@ -171,6 +171,10 @@ fn global_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
171 KeyCodeSerde::Char('c'), 171 KeyCodeSerde::Char('c'),
172 HashMap::from([(2, String::from("cp ${url}"))]), 172 HashMap::from([(2, String::from("cp ${url}"))]),
173 ), 173 ),
174 (
175 KeyCodeSerde::Char('y'),
176 HashMap::from([(0, String::from("cp ${url}"))]),
177 ),
174 ]) 178 ])
175} 179}
176 180
@@ -179,6 +183,7 @@ fn search_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
179 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 183 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
180 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 184 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
181 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])), 185 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
186 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
182 ]) 187 ])
183} 188}
184 189
@@ -191,6 +196,7 @@ fn channel_playlists_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
191 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 196 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
192 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 197 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
193 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])), 198 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
199 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
194 ]) 200 ])
195} 201}
196 202
@@ -199,6 +205,7 @@ fn channel_videos_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
199 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 205 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
200 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 206 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
201 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])), 207 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
208 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
202 ]) 209 ])
203} 210}
204 211
@@ -207,6 +214,7 @@ fn playlist_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
207 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 214 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
208 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 215 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
209 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])), 216 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
217 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
210 ]) 218 ])
211} 219}
212 220
@@ -215,6 +223,7 @@ fn popular_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
215 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 223 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
216 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 224 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
217 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])), 225 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
226 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
218 ]) 227 ])
219} 228}
220 229
@@ -223,18 +232,23 @@ fn trending_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
223 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 232 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
224 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 233 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
225 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])), 234 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
235 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
226 ]) 236 ])
227} 237}
228 238
229fn video_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> { 239fn video_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
230 HashMap::default() 240 HashMap::from([(
241 KeyCodeSerde::Char(' '),
242 HashMap::from([(0, String::from("parrun mpv '${embed-url}'"))]),
243 )])
231} 244}
232 245
233fn watchhistory_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> { 246fn watchhistory_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
234 HashMap::from([ 247 HashMap::from([
235 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 248 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
236 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 249 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
237 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])) 250 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
251 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
238 ]) 252 ])
239} 253}
240 254
@@ -253,6 +267,7 @@ fn feed_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
253 KeyCodeSerde::Char('p'), 267 KeyCodeSerde::Char('p'),
254 HashMap::from([(2, String::from("parrun mpv '${hover-video-url}'"))]), 268 HashMap::from([(2, String::from("parrun mpv '${hover-video-url}'"))]),
255 ), 269 ),
270 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
256 ]) 271 ])
257} 272}
258 273
@@ -260,6 +275,7 @@ fn library_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
260 HashMap::from([ 275 HashMap::from([
261 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])), 276 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
262 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), 277 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
263 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])) 278 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
279 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
264 ]) 280 ])
265} 281}
src/config/keybindings.rs +8
@@ -95,6 +95,10 @@ impl Default for KeyBindingsConfigSerde {
95 KeyCodeSerde::Char('q'), 95 KeyCodeSerde::Char('q'),
96 HashMap::from([(0, KeyAction::Exit)]), 96 HashMap::from([(0, KeyAction::Exit)]),
97 ), 97 ),
98 (
99 KeyCodeSerde::F("F5".to_string()),
100 HashMap::from([(0, KeyAction::Reload)]),
101 ),
98 ( 102 (
99 KeyCodeSerde::Char('r'), 103 KeyCodeSerde::Char('r'),
100 HashMap::from([(2, KeyAction::Reload)]), 104 HashMap::from([(2, KeyAction::Reload)]),
@@ -104,6 +108,10 @@ impl Default for KeyBindingsConfigSerde {
104 HashMap::from([(0, KeyAction::StartCommandCapture)]), 108 HashMap::from([(0, KeyAction::StartCommandCapture)]),
105 ), 109 ),
106 // history 110 // history
111 (
112 KeyCodeSerde::Char('d'),
113 HashMap::from([(0, KeyAction::ClearHistory), (4, KeyAction::RemoveWord)]),
114 ),
107 ( 115 (
108 KeyCodeSerde::KeyVariants(KeyVariantsSerde::Backspace), 116 KeyCodeSerde::KeyVariants(KeyVariantsSerde::Backspace),
109 HashMap::from([(0, KeyAction::Back)]), 117 HashMap::from([(0, KeyAction::Back)]),
src/config/main.rs +1 −1
@@ -140,7 +140,7 @@ impl Provider {
140// default functions 140// default functions
141 141
142fn invidious_instance_default() -> String { 142fn invidious_instance_default() -> String {
143 String::from("https://y.com.sb") 143 String::from("https://vid.puffyan.us")
144} 144}
145 145
146fn message_bar_default_default() -> String { 146fn message_bar_default_default() -> String {
src/items/channellist.rs −1
@@ -1,4 +1,3 @@
1
2use ratatui::{ 1use ratatui::{
3 layout::{Constraint, Rect}, 2 layout::{Constraint, Rect},
4 style::Style, 3 style::Style,
src/items/searchbar.rs +2 −1
@@ -3,7 +3,8 @@ use std::error::Error;
3use crate::{config::*, global::structs::*}; 3use crate::{config::*, global::structs::*};
4 4
5#[cfg(feature = "clipboard")] 5#[cfg(feature = "clipboard")]
6use crate::global::functions::*; 6use crate::global::functions::get_clipboard;
7use crate::global::functions::{next_word, previous_word, remove_word};
7 8
8use crossterm::event::KeyCode; 9use crossterm::event::KeyCode;
9use ratatui::{ 10use ratatui::{
src/items/videolist.rs −1
@@ -1,4 +1,3 @@
1
2use ratatui::{ 1use ratatui::{
3 layout::{Constraint, Rect}, 2 layout::{Constraint, Rect},
4 style::Style, 3 style::Style,