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 @@
33- [Overview](README.md)
44- [Installation](installation.md)
55- [Basic usage](basic_usage.md)
6- [Invidious](invidious.md)
67- [Commands](commands.md)
78
89# Customisation guide
docs/src/changelogs.md +9 −6
@@ -1,23 +1,26 @@
11# Changelogs
22
3### v0.7.4 (latest unstable on git)
3## v0.7.4 (latest stable on crates.io)
44
5#### Added
5### Added
66
77- `Ctrl + w` and `Ctrl + u` in search bar and command mode.
88- Keybindings works even when an item is selected (`legacy_input_handling: false` in `main.yml`).
9- Creating fake key input using `:key`
910
10#### Fixed
11### Fixed
1112
1213- 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)
1316
14## v0.7.3 (latest stable on crates.io)
17### v0.7.3
1518
16### Added
19#### Added
1720
1821- Lazy feed syncing (configurable), so you are not actively ddosing the Invidious instance as badly.
1922
20### Fixed
23#### Fixed
2124
2225- Search bar no longer shows escaped search query: the original text string is displayed instead.
2326- 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>> {
171171 KeyCodeSerde::Char('c'),
172172 HashMap::from([(2, String::from("cp ${url}"))]),
173173 ),
174 (
175 KeyCodeSerde::Char('y'),
176 HashMap::from([(0, String::from("cp ${url}"))]),
177 ),
174178 ])
175179}
176180
@@ -179,6 +183,7 @@ fn search_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
179183 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
180184 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
181185 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
186 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
182187 ])
183188}
184189
@@ -191,6 +196,7 @@ fn channel_playlists_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
191196 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
192197 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
193198 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
199 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
194200 ])
195201}
196202
@@ -199,6 +205,7 @@ fn channel_videos_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
199205 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
200206 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
201207 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
208 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
202209 ])
203210}
204211
@@ -207,6 +214,7 @@ fn playlist_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
207214 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
208215 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
209216 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
217 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
210218 ])
211219}
212220
@@ -215,6 +223,7 @@ fn popular_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
215223 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
216224 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
217225 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
226 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
218227 ])
219228}
220229
@@ -223,18 +232,23 @@ fn trending_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
223232 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
224233 (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])),
225234 (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("parrun mpv '${hover-url}'"))])),
235 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
226236 ])
227237}
228238
229239fn 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 )])
231244}
232245
233246fn watchhistory_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
234247 HashMap::from([
235248 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
236249 (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}'"))])),
238252 ])
239253}
240254
@@ -253,6 +267,7 @@ fn feed_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
253267 KeyCodeSerde::Char('p'),
254268 HashMap::from([(2, String::from("parrun mpv '${hover-video-url}'"))]),
255269 ),
270 (KeyCodeSerde::Char(' '), HashMap::from([(0, String::from("parrun mpv '${hover-url}'"))])),
256271 ])
257272}
258273
@@ -260,6 +275,7 @@ fn library_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> {
260275 HashMap::from([
261276 (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("parrun ${terminal-emulator} mpv '${hover-url}' --no-video"))])),
262277 (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}'"))])),
264280 ])
265281}
src/config/keybindings.rs +8
@@ -95,6 +95,10 @@ impl Default for KeyBindingsConfigSerde {
9595 KeyCodeSerde::Char('q'),
9696 HashMap::from([(0, KeyAction::Exit)]),
9797 ),
98 (
99 KeyCodeSerde::F("F5".to_string()),
100 HashMap::from([(0, KeyAction::Reload)]),
101 ),
98102 (
99103 KeyCodeSerde::Char('r'),
100104 HashMap::from([(2, KeyAction::Reload)]),
@@ -104,6 +108,10 @@ impl Default for KeyBindingsConfigSerde {
104108 HashMap::from([(0, KeyAction::StartCommandCapture)]),
105109 ),
106110 // history
111 (
112 KeyCodeSerde::Char('d'),
113 HashMap::from([(0, KeyAction::ClearHistory), (4, KeyAction::RemoveWord)]),
114 ),
107115 (
108116 KeyCodeSerde::KeyVariants(KeyVariantsSerde::Backspace),
109117 HashMap::from([(0, KeyAction::Back)]),
src/config/main.rs +1 −1
@@ -140,7 +140,7 @@ impl Provider {
140140// default functions
141141
142142fn invidious_instance_default() -> String {
143 String::from("https://y.com.sb")
143 String::from("https://vid.puffyan.us")
144144}
145145
146146fn message_bar_default_default() -> String {
src/items/channellist.rs −1
@@ -1,4 +1,3 @@
1
21use ratatui::{
32 layout::{Constraint, Rect},
43 style::Style,
src/items/searchbar.rs +2 −1
@@ -3,7 +3,8 @@ use std::error::Error;
33use crate::{config::*, global::structs::*};
44
55#[cfg(feature = "clipboard")]
6use crate::global::functions::*;
6use crate::global::functions::get_clipboard;
7use crate::global::functions::{next_word, previous_word, remove_word};
78
89use crossterm::event::KeyCode;
910use ratatui::{
src/items/videolist.rs −1
@@ -1,4 +1,3 @@
1
21use ratatui::{
32 layout::{Constraint, Rect},
43 style::Style,