From db1ab3212084645cf395ab30defaa50d527e9817 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Sun, 10 Jul 2022 22:34:05 +0100 Subject: [PATCH 01/22] Did more refacroring and made a better loop for anime as well as error handeling in anime --- Cargo.lock | 20 ++++++------- Cargo.toml | 2 +- src/anime.rs | 1 + src/anime/anime.rs | 60 +++++++++++++++++++++++++++++++++++++ src/anime/scraper.rs | 2 +- src/helpers/take_input.rs | 8 ++++- src/ln.rs | 1 + src/ln/ln.rs | 23 ++++++++++++++ src/main.rs | 63 +++------------------------------------ 9 files changed, 108 insertions(+), 72 deletions(-) create mode 100644 src/anime/anime.rs create mode 100644 src/ln/ln.rs diff --git a/Cargo.lock b/Cargo.lock index 433b680..488a5f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,6 +276,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +[[package]] +name = "kami" +version = "0.2.0" +dependencies = [ + "base64", + "colored", + "isahc", + "regex", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -319,16 +329,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "log_e" -version = "0.2.0" -dependencies = [ - "base64", - "colored", - "isahc", - "regex", -] - [[package]] name = "matches" version = "0.1.9" diff --git a/Cargo.toml b/Cargo.toml index 0bb0975..ecb46e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "log_e" +name = "kami" #author = "mrfluffy-dev" license = "GPL-3.0" version = "0.2.0" diff --git a/src/anime.rs b/src/anime.rs index 2b52c90..a2c4f5a 100644 --- a/src/anime.rs +++ b/src/anime.rs @@ -1,2 +1,3 @@ pub mod player; pub mod scraper; +pub mod anime; diff --git a/src/anime/anime.rs b/src/anime/anime.rs new file mode 100644 index 0000000..0239180 --- /dev/null +++ b/src/anime/anime.rs @@ -0,0 +1,60 @@ +use crate::{string_input,int_input,u16_input}; +use crate::{anime_names,anime_ep_range,anime_link}; +use crate::open_video; +use crate::main; +use colored::Colorize; +//use crate +pub fn anime_stream(){ + let query = if std::env::args().len() > 2 { + std::env::args().nth(2).unwrap() + } else { + string_input("Enter query: ") + }; + let anime_list = anime_names(&query); + let mut count = 0; + print!("\x1B[2J\x1B[1;1H"); + anime_list.iter().for_each(|anime| { + if count % 2 == 0 { + println!( + "({})\t{}", + format_args!("{}", count.to_string().blue()), + format_args!("{}", anime.blue()) + ); + } else { + println!( + "({})\t{}", + format_args!("{}", count.to_string().yellow()), + format_args!("{}", anime.yellow()) + ); + } + count += 1; + }); + let mut anime_num: usize = usize::MAX; + while anime_num == usize::max_value() || anime_num >= anime_list.len() { + anime_num = int_input("Enter anime number: "); + if anime_num >= anime_list.len() { + println!("Invalid anime number"); + } + } + let title = &anime_list[anime_num]; + let ep_range = anime_ep_range(title); + // if there is only one episode, then don't ask user to choose episode + if ep_range == 1 { + let link = anime_link(title, 1); + open_video(link); + main(); + } else { + loop{ + println!("select episode 1-{}: ", ep_range); + let mut ep_num: usize = usize::MAX; + while ep_num == usize::max_value() || ep_num >= ep_range as usize { + ep_num = int_input("Enter episode number: "); + if ep_num >= ep_range as usize { + println!("Invalid episode number"); + } + } + let link = anime_link(title, ep_num as u64); + open_video(link); + } + } +} diff --git a/src/anime/scraper.rs b/src/anime/scraper.rs index 4c017c0..a4e6edf 100644 --- a/src/anime/scraper.rs +++ b/src/anime/scraper.rs @@ -66,7 +66,7 @@ pub fn anime_ep_range(anime_name: &str) -> u16 { .unwrap_or(0) } -pub fn anime_link(title: &str, ep: u16) -> (String, String) { +pub fn anime_link(title: &str, ep: u64) -> (String, String) { let url = format!("https://animixplay.to/v1/{}", title); let html = get_anime_html(&url); let re = Regex::new(r#"(?m)\?id=([^&]+)"#).unwrap(); diff --git a/src/helpers/take_input.rs b/src/helpers/take_input.rs index 8afe6b4..19e69f2 100644 --- a/src/helpers/take_input.rs +++ b/src/helpers/take_input.rs @@ -17,7 +17,13 @@ pub fn int_input(prompt: &str) -> usize { io::stdin() .read_line(&mut input) .expect("Error reading from STDIN"); - input.trim().parse::().unwrap() + //try to parse the input as usize else return max usize + match input.trim().parse::() { + Ok(i) => i, + Err(_) => { + usize::max_value() + } + } } pub fn u16_input(prompt: &str) -> u16 { diff --git a/src/ln.rs b/src/ln.rs index 9e16fe7..ca48542 100644 --- a/src/ln.rs +++ b/src/ln.rs @@ -2,3 +2,4 @@ pub mod menu; pub mod open_text; pub mod scraper; pub mod search; +pub mod ln; diff --git a/src/ln/ln.rs b/src/ln/ln.rs new file mode 100644 index 0000000..085d3a1 --- /dev/null +++ b/src/ln/ln.rs @@ -0,0 +1,23 @@ +use std::fs::File; +use std::io::Write; +use crate::{search_ln,chapter_selector,get_full_text,open_bat}; +pub fn ln(){ + let ln_url = search_ln(); + let mut selected_page = 1; + loop { + //make empty tuple called chapter_url with (String, u32, u32) + let chapter_url = chapter_selector(&ln_url, selected_page); + selected_page = chapter_url.1; + let full_text = get_full_text(&chapter_url.0); + //write full_text to file called temp.txt + let mut file = File::create("/tmp/log_e").expect("Unable to create file"); + file.write_all(full_text.as_bytes()) + .expect("Unable to write to file"); + //close file + file.sync_all().expect("Unable to sync file"); + //open temp.txt in cat for user to read + let _com = open_bat(); + print!("\x1B[2J\x1B[1;1H"); + } + +} diff --git a/src/main.rs b/src/main.rs index c64603e..a1444df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ -use std::fs::File; -use std::io::Write; - +use crate::anime::anime::anime_stream; use crate::anime::scraper::{anime_ep_range, anime_link, anime_names}; +use crate::ln::ln::ln; use crate::ln::menu::chapter_selector; use crate::ln::open_text::open_bat; use crate::ln::scraper::get_full_text; @@ -31,63 +30,9 @@ fn main() { std::process::exit(0); } if _arg == "l" { - let ln_url = search_ln(); - let mut selected_page = 1; - loop { - //make empty tuple called chapter_url with (String, u32, u32) - let chapter_url = chapter_selector(&ln_url, selected_page); - selected_page = chapter_url.1; - let full_text = get_full_text(&chapter_url.0); - //write full_text to file called temp.txt - let mut file = File::create("/tmp/log_e").expect("Unable to create file"); - file.write_all(full_text.as_bytes()) - .expect("Unable to write to file"); - //close file - file.sync_all().expect("Unable to sync file"); - //open temp.txt in cat for user to read - let _com = open_bat(); - print!("\x1B[2J\x1B[1;1H"); - } + ln(); } else if _arg == "a" { - let query = if std::env::args().len() > 2 { - std::env::args().nth(2).unwrap() - } else { - string_input("Enter query: ") - }; - let anime_list = anime_names(&query); - let mut count = 0; - print!("\x1B[2J\x1B[1;1H"); - anime_list.iter().for_each(|anime| { - if count % 2 == 0 { - println!( - "({})\t{}", - format_args!("{}", count.to_string().blue()), - format_args!("{}", anime.blue()) - ); - } else { - println!( - "({})\t{}", - format_args!("{}", count.to_string().yellow()), - format_args!("{}", anime.yellow()) - ); - } - count += 1; - }); - let anime_num = int_input("Enter anime number: "); - let title = &anime_list[anime_num]; - let ep_range = anime_ep_range(title); - // if there is only one episode, then don't ask user to choose episode - if ep_range == 1 { - let link = anime_link(title, 1); - open_video(link); - main(); - } else { - println!("select episode 1-{}: ", ep_range); - let ep_num = u16_input("Enter episode number: "); - let link = anime_link(title, ep_num); - open_video(link); - main(); - } + anime_stream() } else { println!("Invalid argument"); } From 7c8ec33d05246be282ef9c7ded0702ffe2af2527 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Sun, 10 Jul 2022 22:35:30 +0100 Subject: [PATCH 02/22] commented out u16_input function --- src/helpers/take_input.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/helpers/take_input.rs b/src/helpers/take_input.rs index 19e69f2..659e299 100644 --- a/src/helpers/take_input.rs +++ b/src/helpers/take_input.rs @@ -26,12 +26,12 @@ pub fn int_input(prompt: &str) -> usize { } } -pub fn u16_input(prompt: &str) -> u16 { - print!("{}", prompt); - let mut input = String::new(); - let _ = io::stdout().flush(); - io::stdin() - .read_line(&mut input) - .expect("Error reading from STDIN"); - input.trim().parse::().unwrap() -} +//pub fn u16_input(prompt: &str) -> u16 { +// print!("{}", prompt); +// let mut input = String::new(); +// let _ = io::stdout().flush(); +// io::stdin() +// .read_line(&mut input) +// .expect("Error reading from STDIN"); +// input.trim().parse::().unwrap() +//} From 40e308dab4b2d2407cb800554786a90dd62b0741 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 11 Jul 2022 16:26:08 +0100 Subject: [PATCH 03/22] fixed bug where you could not watch the last episode --- src/anime/anime.rs | 10 +++++----- src/ln/ln.rs | 2 +- src/ln/menu.rs | 15 ++++++++++----- src/main.rs | 6 +++--- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/anime/anime.rs b/src/anime/anime.rs index 0239180..29769db 100644 --- a/src/anime/anime.rs +++ b/src/anime/anime.rs @@ -1,4 +1,4 @@ -use crate::{string_input,int_input,u16_input}; +use crate::{string_input,int_input}; use crate::{anime_names,anime_ep_range,anime_link}; use crate::open_video; use crate::main; @@ -30,9 +30,9 @@ pub fn anime_stream(){ count += 1; }); let mut anime_num: usize = usize::MAX; - while anime_num == usize::max_value() || anime_num >= anime_list.len() { + while anime_num == usize::max_value() || anime_num > anime_list.len() { anime_num = int_input("Enter anime number: "); - if anime_num >= anime_list.len() { + if anime_num > anime_list.len() { println!("Invalid anime number"); } } @@ -47,9 +47,9 @@ pub fn anime_stream(){ loop{ println!("select episode 1-{}: ", ep_range); let mut ep_num: usize = usize::MAX; - while ep_num == usize::max_value() || ep_num >= ep_range as usize { + while ep_num == usize::max_value() || ep_num > ep_range as usize { ep_num = int_input("Enter episode number: "); - if ep_num >= ep_range as usize { + if ep_num > ep_range as usize { println!("Invalid episode number"); } } diff --git a/src/ln/ln.rs b/src/ln/ln.rs index 085d3a1..d733ee0 100644 --- a/src/ln/ln.rs +++ b/src/ln/ln.rs @@ -1,7 +1,7 @@ use std::fs::File; use std::io::Write; use crate::{search_ln,chapter_selector,get_full_text,open_bat}; -pub fn ln(){ +pub fn ln_read(){ let ln_url = search_ln(); let mut selected_page = 1; loop { diff --git a/src/ln/menu.rs b/src/ln/menu.rs index 34f0b46..caf485b 100644 --- a/src/ln/menu.rs +++ b/src/ln/menu.rs @@ -11,8 +11,7 @@ use crate::{ }; pub fn chapter_selector(ln_url: &str, mut selected_page: u32) -> (String, u32) { - let exit = false; - while exit == false { + loop { let ln_html = ln::scraper::get_html(ln_url); let ln_id = get_ln_id(&ln_html); let ln_last_page = get_ln_last_page(&ln_html); @@ -42,11 +41,17 @@ pub fn chapter_selector(ln_url: &str, mut selected_page: u32) -> (String, u32) { main(); } else { let chapter_number = chapter_number.trim().to_string(); - let chapter_number = chapter_number.parse::().unwrap(); - let chapter_url = &ln_chapters_urls[chapter_number]; + let mut chapter_number_int = 0; + if chapter_number.parse::().is_ok() { + chapter_number_int = chapter_number.parse::().unwrap(); + } else { + println!("{}", "Invalid chapter number".red()); + continue; + } + //let chapter_number = chapter_number.parse::().unwrap(); + let chapter_url = &ln_chapters_urls[chapter_number_int as usize]; let chapter_url = chapter_url.trim().to_string(); return (chapter_url, selected_page); } } - ("".to_string(), 1) } diff --git a/src/main.rs b/src/main.rs index a1444df..57e42af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,12 @@ use crate::anime::anime::anime_stream; use crate::anime::scraper::{anime_ep_range, anime_link, anime_names}; -use crate::ln::ln::ln; +use crate::ln::ln::ln_read; use crate::ln::menu::chapter_selector; use crate::ln::open_text::open_bat; use crate::ln::scraper::get_full_text; use crate::{ anime::player::open_video, - helpers::take_input::{int_input, string_input, u16_input}, + helpers::take_input::{int_input, string_input}, ln::search::search_ln, }; use colored::Colorize; @@ -30,7 +30,7 @@ fn main() { std::process::exit(0); } if _arg == "l" { - ln(); + ln_read(); } else if _arg == "a" { anime_stream() } else { From 0a0c29eb324c055fd995be5699af2df79629fbc3 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 11 Jul 2022 19:22:52 +0100 Subject: [PATCH 04/22] added next and previus episode to anime --- src/anime/anime.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/anime/anime.rs b/src/anime/anime.rs index 29769db..07e3d34 100644 --- a/src/anime/anime.rs +++ b/src/anime/anime.rs @@ -44,7 +44,6 @@ pub fn anime_stream(){ open_video(link); main(); } else { - loop{ println!("select episode 1-{}: ", ep_range); let mut ep_num: usize = usize::MAX; while ep_num == usize::max_value() || ep_num > ep_range as usize { @@ -53,8 +52,30 @@ pub fn anime_stream(){ println!("Invalid episode number"); } } + + loop{ let link = anime_link(title, ep_num as u64); open_video(link); + println!("{}","n: next episode".green()); + println!("{}","p: previous episode".yellow()); + println!("{}","q: quit".red()); + let input = string_input("Enter command: "); + if input == "n" { + if ep_num == ep_range as usize { + println!("No more episodes"); + } else { + ep_num += 1; + } + } else if input == "p" { + if ep_num == 1 { + println!("No previous episodes"); + } else { + ep_num -= 1; + } + } else if input == "q" { + std::process::exit(0); + } + } } } From f9ece6bcc7f484c4603724a8ee32f0b948894352 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 11 Jul 2022 19:23:09 +0100 Subject: [PATCH 05/22] removed comment --- src/ln/menu.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ln/menu.rs b/src/ln/menu.rs index caf485b..b0cf4e4 100644 --- a/src/ln/menu.rs +++ b/src/ln/menu.rs @@ -48,7 +48,6 @@ pub fn chapter_selector(ln_url: &str, mut selected_page: u32) -> (String, u32) { println!("{}", "Invalid chapter number".red()); continue; } - //let chapter_number = chapter_number.parse::().unwrap(); let chapter_url = &ln_chapters_urls[chapter_number_int as usize]; let chapter_url = chapter_url.trim().to_string(); return (chapter_url, selected_page); From 7b02787e62be05183b820804b7743d0ec01bb775 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 11 Jul 2022 19:40:03 +0100 Subject: [PATCH 06/22] added a search another title option to anime --- src/anime/anime.rs | 8 ++++++-- src/main.rs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/anime/anime.rs b/src/anime/anime.rs index 07e3d34..f4e4b68 100644 --- a/src/anime/anime.rs +++ b/src/anime/anime.rs @@ -4,8 +4,8 @@ use crate::open_video; use crate::main; use colored::Colorize; //use crate -pub fn anime_stream(){ - let query = if std::env::args().len() > 2 { +pub fn anime_stream(first_run: bool) { + let query = if std::env::args().len() > 2 && first_run { std::env::args().nth(2).unwrap() } else { string_input("Enter query: ") @@ -58,6 +58,7 @@ pub fn anime_stream(){ open_video(link); println!("{}","n: next episode".green()); println!("{}","p: previous episode".yellow()); + println!("{}","s: search another anime".green()); println!("{}","q: quit".red()); let input = string_input("Enter command: "); if input == "n" { @@ -72,6 +73,9 @@ pub fn anime_stream(){ } else { ep_num -= 1; } + } else if input == "s" { + //remove all the arguments + anime_stream(false); } else if input == "q" { std::process::exit(0); } diff --git a/src/main.rs b/src/main.rs index 57e42af..a9cbd1f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,7 @@ fn main() { if _arg == "l" { ln_read(); } else if _arg == "a" { - anime_stream() + anime_stream(true) } else { println!("Invalid argument"); } From c4d7f85d9dcbc3c2b947be14b34d879d6f2a6380 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 11 Jul 2022 19:46:04 +0100 Subject: [PATCH 07/22] added an output "invalid command" if the anime menue option is invalid --- src/anime/anime.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/anime/anime.rs b/src/anime/anime.rs index f4e4b68..e2cca91 100644 --- a/src/anime/anime.rs +++ b/src/anime/anime.rs @@ -79,7 +79,9 @@ pub fn anime_stream(first_run: bool) { } else if input == "q" { std::process::exit(0); } - + else{ + println!("Invalid command"); + } } } } From 619b8c7f596218cdaa0adcf17e323ab76cb77ff8 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 11 Jul 2022 19:48:27 +0100 Subject: [PATCH 08/22] changed search string for anime to "Search anime" --- src/anime/anime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/anime/anime.rs b/src/anime/anime.rs index e2cca91..d7207aa 100644 --- a/src/anime/anime.rs +++ b/src/anime/anime.rs @@ -8,7 +8,7 @@ pub fn anime_stream(first_run: bool) { let query = if std::env::args().len() > 2 && first_run { std::env::args().nth(2).unwrap() } else { - string_input("Enter query: ") + string_input("Search anime: ") }; let anime_list = anime_names(&query); let mut count = 0; From 86703d3bbd1d4c283b1c070d997ca88713cdfe23 Mon Sep 17 00:00:00 2001 From: mrfluffy <53239525+mrfluffy-dev@users.noreply.github.com> Date: Mon, 11 Jul 2022 21:05:21 +0100 Subject: [PATCH 09/22] Update README.org --- README.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.org b/README.org index bfe54c9..6798ce0 100644 --- a/README.org +++ b/README.org @@ -1,5 +1,9 @@ #+title: Readme +* Dependancies +1. bat +2. mpv + * Install 1. #+begin_src shell From 36ac04079c0d7de2d9d19cc63b459830fe5948b4 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 11 Jul 2022 23:56:58 +0100 Subject: [PATCH 10/22] reworked the light novel menue to make it more cohesive as well as did error handeling in ln/search.rs --- src/ln/menu.rs | 21 +++++++++++++-------- src/ln/search.rs | 12 +++++------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/ln/menu.rs b/src/ln/menu.rs index b0cf4e4..d2a2ab6 100644 --- a/src/ln/menu.rs +++ b/src/ln/menu.rs @@ -27,9 +27,10 @@ pub fn chapter_selector(ln_url: &str, mut selected_page: u32) -> (String, u32) { } count += 1; }); - println!("(n)\t{}", "Go to next page".red()); - println!("(b)\t{}", "Go to previous page".red()); - println!("(q)\t{}", "go back to main menu".red()); + println!("(n)\t{}", "Go to next page".green()); + println!("(b)\t{}", "Go to previous page".yellow()); + println!("(s)\t{}", "Search another title".red()); + println!("(q)\t{}", "quit".red()); let chapter_number = string_input("Which chapter do you want to read? "); if chapter_number == "n" && selected_page < ln_last_page.parse::().unwrap() { selected_page += 1; @@ -38,17 +39,21 @@ pub fn chapter_selector(ln_url: &str, mut selected_page: u32) -> (String, u32) { selected_page -= 1; print!("\x1B[2J\x1B[1;1H"); } else if chapter_number == "q" { + print!("\x1B[2J\x1B[1;1H"); + std::process::exit(0); + } else if chapter_number == "s" { main(); - } else { + } + else { let chapter_number = chapter_number.trim().to_string(); - let mut chapter_number_int = 0; + let mut _chapter_number_int = 0; if chapter_number.parse::().is_ok() { - chapter_number_int = chapter_number.parse::().unwrap(); + _chapter_number_int = chapter_number.parse::().unwrap(); } else { - println!("{}", "Invalid chapter number".red()); + println!("{}", "Invalid option".red()); continue; } - let chapter_url = &ln_chapters_urls[chapter_number_int as usize]; + let chapter_url = &ln_chapters_urls[_chapter_number_int as usize]; let chapter_url = chapter_url.trim().to_string(); return (chapter_url, selected_page); } diff --git a/src/ln/search.rs b/src/ln/search.rs index 8b70e49..9788eec 100644 --- a/src/ln/search.rs +++ b/src/ln/search.rs @@ -29,13 +29,9 @@ pub fn search_ln() -> String { } count += 1; }); - println!("(n)\t{}", "Search another title".red()); - let mut ln_number = String::new(); - std::io::stdin() - .read_line(&mut ln_number) - .expect("Failed to read line"); - ln_number = ln_number.trim().to_string(); - if ln_number != "n" { + println!("(s)\t{}", "Search another title".green()); + let ln_number = string_input("Enter an option: "); + if ln_number != "s" && ln_number.parse::().is_ok() { let ln_number = ln_number.trim().to_string(); let ln_number = ln_number.parse::().unwrap(); let ln_url = &ln_urls[ln_number]; @@ -43,6 +39,8 @@ pub fn search_ln() -> String { _is_n = true; print!("\x1B[2J\x1B[1;1H"); return ln_url; + } else { + print!("invalid input"); } print!("\x1B[2J\x1B[1;1H"); } From 5577dc4b1ab21d99e59a191c4ba7a78dbe6c69ae Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Tue, 12 Jul 2022 00:08:54 +0100 Subject: [PATCH 11/22] made the ui look the same thruout the program --- src/ln/menu.rs | 12 ++++++------ src/ln/search.rs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ln/menu.rs b/src/ln/menu.rs index d2a2ab6..3e35123 100644 --- a/src/ln/menu.rs +++ b/src/ln/menu.rs @@ -21,16 +21,16 @@ pub fn chapter_selector(ln_url: &str, mut selected_page: u32) -> (String, u32) { let mut count = 0; ln_chapters.into_iter().for_each(|chaprer| { if count % 2 == 0 { - println!("({})\t{}", count, format_args!("{}", chaprer.blue())); + println!("({})\t{}", count.to_string().blue(), format_args!("{}", chaprer.blue())); } else { - println!("({})\t{}", count, format_args!("{}", chaprer.yellow())); + println!("({})\t{}", count.to_string().yellow(), format_args!("{}", chaprer.yellow())); } count += 1; }); - println!("(n)\t{}", "Go to next page".green()); - println!("(b)\t{}", "Go to previous page".yellow()); - println!("(s)\t{}", "Search another title".red()); - println!("(q)\t{}", "quit".red()); + println!("{}\t{}","n:".green(), "Go to next page".green()); + println!("{}\t{}","b:".yellow(), "Go to previous page".yellow()); + println!("{}\t{}","s:".green(), "Search another title".green()); + println!("{}\t{}","q:".red(), "quit".red()); let chapter_number = string_input("Which chapter do you want to read? "); if chapter_number == "n" && selected_page < ln_last_page.parse::().unwrap() { selected_page += 1; diff --git a/src/ln/search.rs b/src/ln/search.rs index 9788eec..6a567c8 100644 --- a/src/ln/search.rs +++ b/src/ln/search.rs @@ -23,13 +23,13 @@ pub fn search_ln() -> String { let mut count = 0; ln_titles.into_iter().for_each(|ln| { if count % 2 == 0 { - println!("({})\t{}", count, format_args!("{}", ln.blue())); + println!("({})\t{}", count.to_string().blue(), format_args!("{}", ln.blue())); } else { - println!("({})\t{}", count, format_args!("{}", ln.yellow())); + println!("({})\t{}", count.to_string().yellow(), format_args!("{}", ln.yellow())); } count += 1; }); - println!("(s)\t{}", "Search another title".green()); + println!("{}\t{}","s:".green(), "Search another title".green()); let ln_number = string_input("Enter an option: "); if ln_number != "s" && ln_number.parse::().is_ok() { let ln_number = ln_number.trim().to_string(); From 62288ea334b4ee9ccd3d8b038ee9899821a2b203 Mon Sep 17 00:00:00 2001 From: newbee1905 Date: Tue, 12 Jul 2022 12:55:35 +0700 Subject: [PATCH 12/22] (feat) Soft wrap text with fold --- src/ln/open_text.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ln/open_text.rs b/src/ln/open_text.rs index 6e736e6..21928db 100644 --- a/src/ln/open_text.rs +++ b/src/ln/open_text.rs @@ -1,11 +1,20 @@ use std::io::Result; -use std::process::{Command, ExitStatus}; +use std::process::{Command, ExitStatus, Stdio}; pub fn open_bat() -> Result { + let soft_wrap = match Command::new("fold") + .arg("-s") + .arg("/tmp/log_e") + .stdout(Stdio::piped()) + .spawn() + { + Err(why) => panic!("couldn't spawn wc: {}", why), + Ok(soft_wrap) => soft_wrap, + }; Command::new("bat") .arg("--paging") .arg("always") - .arg("/tmp/log_e") + .stdin(soft_wrap.stdout.unwrap()) .spawn()? .wait() } From 8e0edf66fe81e1a40de6401f81a49343475fc336 Mon Sep 17 00:00:00 2001 From: newbee1905 Date: Tue, 12 Jul 2022 13:54:25 +0700 Subject: [PATCH 13/22] (feat) MD syntax for bat|non fixed width for fold --- src/ln/open_text.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ln/open_text.rs b/src/ln/open_text.rs index 21928db..446edfb 100644 --- a/src/ln/open_text.rs +++ b/src/ln/open_text.rs @@ -2,8 +2,16 @@ use std::io::Result; use std::process::{Command, ExitStatus, Stdio}; pub fn open_bat() -> Result { + let terminal_cols_cmd = Command::new("tput").arg("cols").output()?.stdout; + let terminal_cols: String = match std::str::from_utf8(&terminal_cols_cmd) { + Err(_e) => "80".to_string(), + Ok(v) => (v.trim().parse::().unwrap() - 10).to_string(), + }; + let soft_wrap = match Command::new("fold") .arg("-s") + .arg("-w") + .arg(terminal_cols) .arg("/tmp/log_e") .stdout(Stdio::piped()) .spawn() @@ -11,9 +19,12 @@ pub fn open_bat() -> Result { Err(why) => panic!("couldn't spawn wc: {}", why), Ok(soft_wrap) => soft_wrap, }; + Command::new("bat") .arg("--paging") .arg("always") + .arg("-l") + .arg("markdown") .stdin(soft_wrap.stdout.unwrap()) .spawn()? .wait() From 3155a0d25f5c2aa1a62adc1c586d9ab935dc3b1b Mon Sep 17 00:00:00 2001 From: newbee1905 Date: Wed, 13 Jul 2022 19:36:18 +0700 Subject: [PATCH 14/22] (feat) Use a seperate library to get terminal cols --- Cargo.lock | 90 ++++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 3 +- src/ln/open_text.rs | 9 +---- 3 files changed, 88 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 488a5f2..d72d9fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -45,6 +45,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bytes" version = "1.1.0" @@ -83,7 +89,7 @@ checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" dependencies = [ "atty", "lazy_static", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -117,7 +123,7 @@ dependencies = [ "openssl-sys", "schannel", "socket2", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -133,7 +139,7 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -284,6 +290,17 @@ dependencies = [ "colored", "isahc", "regex", + "termsize", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", ] [[package]] @@ -347,6 +364,12 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "numtoa" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" + [[package]] name = "once_cell" version = "1.12.0" @@ -426,7 +449,7 @@ dependencies = [ "libc", "log", "wepoll-ffi", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -447,6 +470,24 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "redox_syscall" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_termios" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f" +dependencies = [ + "redox_syscall", +] + [[package]] name = "regex" version = "1.5.6" @@ -498,7 +539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -512,6 +553,31 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "termion" +version = "1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e" +dependencies = [ + "libc", + "numtoa", + "redox_syscall", + "redox_termios", +] + +[[package]] +name = "termsize" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e86d824a8e90f342ad3ef4bd51ef7119a9b681b0cc9f8ee7b2852f02ccd2517" +dependencies = [ + "atty", + "kernel32-sys", + "libc", + "termion", + "winapi 0.2.8", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -624,6 +690,12 @@ dependencies = [ "cc", ] +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.9" @@ -634,6 +706,12 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index ecb46e1..c5eb9f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kami" -#author = "mrfluffy-dev" +author = "mrfluffy-dev" license = "GPL-3.0" version = "0.2.0" edition = "2021" @@ -12,3 +12,4 @@ regex = "1.5.6" colored = "2.0.0" isahc = "1.7.2" base64 = "0.13" +termsize = "0.1.6" diff --git a/src/ln/open_text.rs b/src/ln/open_text.rs index 446edfb..ae4c10b 100644 --- a/src/ln/open_text.rs +++ b/src/ln/open_text.rs @@ -2,16 +2,11 @@ use std::io::Result; use std::process::{Command, ExitStatus, Stdio}; pub fn open_bat() -> Result { - let terminal_cols_cmd = Command::new("tput").arg("cols").output()?.stdout; - let terminal_cols: String = match std::str::from_utf8(&terminal_cols_cmd) { - Err(_e) => "80".to_string(), - Ok(v) => (v.trim().parse::().unwrap() - 10).to_string(), - }; - + let termsize::Size {rows: _, cols} = termsize::get().unwrap(); let soft_wrap = match Command::new("fold") .arg("-s") .arg("-w") - .arg(terminal_cols) + .arg((cols - 9).to_string()) .arg("/tmp/log_e") .stdout(Stdio::piped()) .spawn() From 47210dfd15dadd453373d8f363568fac3e9be11e Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Wed, 13 Jul 2022 22:39:54 +0100 Subject: [PATCH 15/22] honestly fuck windows but now it works --- Cargo.lock | 71 ++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 3 +- src/anime/anime.rs | 1 - src/ln/ln.rs | 22 +++++++++----- src/ln/open_text.rs | 17 +++++++++-- 5 files changed, 102 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d72d9fc..61ad740 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,6 +142,26 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + [[package]] name = "encoding_rs" version = "0.8.31" @@ -209,6 +229,17 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "hermit-abi" version = "0.1.19" @@ -284,10 +315,11 @@ checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "kami" -version = "0.2.0" +version = "0.3.0" dependencies = [ "base64", "colored", + "dirs", "isahc", "regex", "termsize", @@ -488,6 +520,17 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + [[package]] name = "regex" version = "1.5.6" @@ -578,6 +621,26 @@ dependencies = [ "winapi 0.2.8", ] +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -681,6 +744,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wepoll-ffi" version = "0.1.2" diff --git a/Cargo.toml b/Cargo.toml index c5eb9f6..e77f56e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "kami" author = "mrfluffy-dev" license = "GPL-3.0" -version = "0.2.0" +version = "0.3.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -13,3 +13,4 @@ colored = "2.0.0" isahc = "1.7.2" base64 = "0.13" termsize = "0.1.6" +dirs = "4.0" diff --git a/src/anime/anime.rs b/src/anime/anime.rs index d7207aa..c283cf0 100644 --- a/src/anime/anime.rs +++ b/src/anime/anime.rs @@ -52,7 +52,6 @@ pub fn anime_stream(first_run: bool) { println!("Invalid episode number"); } } - loop{ let link = anime_link(title, ep_num as u64); open_video(link); diff --git a/src/ln/ln.rs b/src/ln/ln.rs index d733ee0..6622962 100644 --- a/src/ln/ln.rs +++ b/src/ln/ln.rs @@ -9,15 +9,23 @@ pub fn ln_read(){ let chapter_url = chapter_selector(&ln_url, selected_page); selected_page = chapter_url.1; let full_text = get_full_text(&chapter_url.0); - //write full_text to file called temp.txt - let mut file = File::create("/tmp/log_e").expect("Unable to create file"); - file.write_all(full_text.as_bytes()) - .expect("Unable to write to file"); - //close file - file.sync_all().expect("Unable to sync file"); + if cfg!(target_os = "windows"){ + use dirs::home_dir; + let mut home = format!("{:?}",home_dir()).replace("\\\\","/"); + home.drain(0..6); + home.drain(home.len()-2..home.len()); + let mut file = File::create(format!("{}/AppData/Roaming/log_e",home)).expect("Unable to create file"); + file.write_all(full_text.as_bytes()) + .expect("Unable to write to file"); + file.sync_all().expect("Unable to sync file"); + }else{ + let mut file = File::create("/tmp/log_e").expect("Unable to create file"); + file.write_all(full_text.as_bytes()) + .expect("Unable to write to file"); + file.sync_all().expect("Unable to sync file"); + }; //open temp.txt in cat for user to read let _com = open_bat(); print!("\x1B[2J\x1B[1;1H"); } - } diff --git a/src/ln/open_text.rs b/src/ln/open_text.rs index ae4c10b..22678c9 100644 --- a/src/ln/open_text.rs +++ b/src/ln/open_text.rs @@ -1,13 +1,26 @@ use std::io::Result; use std::process::{Command, ExitStatus, Stdio}; +#[allow(unused_assignments)] pub fn open_bat() -> Result { - let termsize::Size {rows: _, cols} = termsize::get().unwrap(); + let termsize::Size {rows: _, cols} = termsize::get().unwrap(); + let mut path = String::new(); + if cfg!(target_os = "windows"){ + use dirs::home_dir; + let mut home = format!("{:?}",home_dir()).replace("\\\\","/"); + home.drain(0..6); + home.drain(home.len()-2..home.len()); + path = format!("{}/AppData/Roaming/log_e",home).to_string(); + } + else{ + path = "/tmp/log_e".to_string(); + } + let soft_wrap = match Command::new("fold") .arg("-s") .arg("-w") .arg((cols - 9).to_string()) - .arg("/tmp/log_e") + .arg(path) .stdout(Stdio::piped()) .spawn() { From d537e03e3c909773c51c947711a572e22bdbe70b Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Thu, 14 Jul 2022 00:28:34 +0100 Subject: [PATCH 16/22] Reworked README.org --- README.org | 87 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index 6798ce0..8b462a0 100644 --- a/README.org +++ b/README.org @@ -1,19 +1,86 @@ #+title: Readme - -* Dependancies -1. bat -2. mpv +#+OPTIONS: toc:2 +* Table of content +1. [[Why use kami][Why use kami]] +2. [[Dependencies][Dependencies]] +3. [[Install][Install]] + - [[Linux/Mac][Linux/mac]] + - [[Windows][Windows]] +4. [[Honorable mentions][Honorable mentions]] +* Why use kami +well its a fast and easy way to watch anime and read light novels right i your terminal no need to open a browser. +Also rust is fast as fuck boiiiii. +* Dependencies +1. [[https://github.com/sharkdp/bat][bat]] +2. [[https://mpv.io/][mpv]] +3. [[https://git-scm.com/][gitbash]](if on windows) +I will be explaining how to install them. * Install -1. +** Linux/Mac +1. install bat and mpv with your package manager(homebrew if on mac) +2. Clone the repo for kami. #+begin_src shell - git clone https://github.com/mrfluffy-dev/kami.git && cd kami +git clone https://github.com/mrfluffy-dev/kami.git && cd kami #+end_src -2. +4. install [[https://www.rust-lang.org/tools/install][Rust]] +5. Build kami using cargo. #+begin_src shell - cargo build --release +cargo build --release #+end_src -3. +6. Copy kami to your path. #+begin_src shell - cp target/release/kami /usr/bin/kami +cp target/release/kami /usr/local/bin/kami #+end_src +** Windows +1. install scoop +#+begin_src shell +Set-ExecutionPolicy RemoteSigned -Scope CurrentUser +irm get.scoop.sh | iex +#+end_src +2. install git +#+begin_src shell +scoop install git +#+end_src +1. install mpv + #+begin_src shell +scoop bucket add extras +scoop install mpv + #+end_src +2. install bat + #+begin_src shell +scoop install bat + #+end_src +3. install [[https://www.rust-lang.org/tools/install][Rust]] +4. (Optional but I highly recommend it) adding bash to windows terminal. + 1. install windows terminal from the Microsoft store. + 2. open the terminal. + 3. open settings. + 4. click "Add a new profile" + 5. click "New empty profile" + 6. Click on "name" and rename it to "Git Bash" + 7. Click on "Command line" and click "Browse..." + 8. if you installed git using scoop then follow this(else the steps are mostly the same just a different path) + navigate to ~C:\User\USERNAME\scoop\apps\git\2.37.1.windows.1\bin\bash.exe~ + Where USERNAME is your username + note that the name ~2.37.1.windows.1~ might be slightly different on your system + 9. click "Open" + 10. Click "Starting directory" and uncheck "Use parent process directory" + 11. Click "Save" + 12. now you can open gitbash from windows terminal +5. Clone the repo for kami + #+begin_src shell +git clone https://github.com/mrfluffy-dev/kami.git && cd kami + #+end_src +6. Build kami using cargo + #+begin_src shell +cargo build --release + #+end_src +7. copy kami to path + #+begin_src +cp target/release/kami.exe /usr/bin/kami + #+end_src +8. open kami by using ~kami~ +* Honorable mentions +- [[https://github.com/pystardust/ani-cli][ani-cli]] just a bunch of fucking nice people. +- [[https://docs.rs/][rust docs]] honestly its just so useful. From dd95c990f741a8879734593e5c2e745f13534c6d Mon Sep 17 00:00:00 2001 From: mrfluffy <53239525+mrfluffy-dev@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:40:30 +0100 Subject: [PATCH 17/22] Update README.org --- README.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.org b/README.org index 8b462a0..7a79518 100644 --- a/README.org +++ b/README.org @@ -1,12 +1,12 @@ #+title: Readme #+OPTIONS: toc:2 * Table of content -1. [[Why use kami][Why use kami]] -2. [[Dependencies][Dependencies]] -3. [[Install][Install]] - - [[Linux/Mac][Linux/mac]] - - [[Windows][Windows]] -4. [[Honorable mentions][Honorable mentions]] +1. [[#Why-use-kami][Why use kami]] +2. [[#Dependencies][Dependencies]] +3. [[#Install][Install]] + - [[#Linux/Mac][Linux/mac]] + - [[#Windows][Windows]] +4. [[#Honorable-mentions][Honorable mentions]] * Why use kami well its a fast and easy way to watch anime and read light novels right i your terminal no need to open a browser. Also rust is fast as fuck boiiiii. From bd31afc7136b51e207b63d185e5a4ae3dc832531 Mon Sep 17 00:00:00 2001 From: mrfluffy <53239525+mrfluffy-dev@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:46:52 +0100 Subject: [PATCH 18/22] Update README.org --- README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 7a79518..cf22c37 100644 --- a/README.org +++ b/README.org @@ -4,7 +4,7 @@ 1. [[#Why-use-kami][Why use kami]] 2. [[#Dependencies][Dependencies]] 3. [[#Install][Install]] - - [[#Linux/Mac][Linux/mac]] + - [[#Linux&Mac][Linux&mac]] - [[#Windows][Windows]] 4. [[#Honorable-mentions][Honorable mentions]] * Why use kami @@ -17,7 +17,7 @@ Also rust is fast as fuck boiiiii. I will be explaining how to install them. * Install -** Linux/Mac +** Linux&Mac 1. install bat and mpv with your package manager(homebrew if on mac) 2. Clone the repo for kami. #+begin_src shell From 38b373377926e374786bdef17158870231401400 Mon Sep 17 00:00:00 2001 From: mrfluffy <53239525+mrfluffy-dev@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:49:27 +0100 Subject: [PATCH 19/22] Update README.org --- README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index cf22c37..41d8201 100644 --- a/README.org +++ b/README.org @@ -4,7 +4,7 @@ 1. [[#Why-use-kami][Why use kami]] 2. [[#Dependencies][Dependencies]] 3. [[#Install][Install]] - - [[#Linux&Mac][Linux&mac]] + - [[#Linux--Mac][Linux/mac]] - [[#Windows][Windows]] 4. [[#Honorable-mentions][Honorable mentions]] * Why use kami @@ -17,7 +17,7 @@ Also rust is fast as fuck boiiiii. I will be explaining how to install them. * Install -** Linux&Mac +** Linux/Mac 1. install bat and mpv with your package manager(homebrew if on mac) 2. Clone the repo for kami. #+begin_src shell From 874e6272f32de81150a6f50055fb012c4904aa5b Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Thu, 14 Jul 2022 00:55:56 +0100 Subject: [PATCH 20/22] fixed indentation on README --- README.org | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index 41d8201..4a31e33 100644 --- a/README.org +++ b/README.org @@ -20,28 +20,28 @@ I will be explaining how to install them. ** Linux/Mac 1. install bat and mpv with your package manager(homebrew if on mac) 2. Clone the repo for kami. -#+begin_src shell + #+begin_src shell git clone https://github.com/mrfluffy-dev/kami.git && cd kami -#+end_src + #+end_src 4. install [[https://www.rust-lang.org/tools/install][Rust]] 5. Build kami using cargo. -#+begin_src shell + #+begin_src shell cargo build --release -#+end_src + #+end_src 6. Copy kami to your path. -#+begin_src shell + #+begin_src shell cp target/release/kami /usr/local/bin/kami -#+end_src + #+end_src ** Windows 1. install scoop -#+begin_src shell + #+begin_src shell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm get.scoop.sh | iex -#+end_src + #+end_src 2. install git -#+begin_src shell + #+begin_src shell scoop install git -#+end_src + #+end_src 1. install mpv #+begin_src shell scoop bucket add extras From eee11e0b0dd1fc3c44685f50c1636c902eac16ce Mon Sep 17 00:00:00 2001 From: mrfluffy <53239525+mrfluffy-dev@users.noreply.github.com> Date: Thu, 14 Jul 2022 01:24:03 +0100 Subject: [PATCH 21/22] Update README.org --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 4a31e33..a6cc710 100644 --- a/README.org +++ b/README.org @@ -4,7 +4,7 @@ 1. [[#Why-use-kami][Why use kami]] 2. [[#Dependencies][Dependencies]] 3. [[#Install][Install]] - - [[#Linux--Mac][Linux/mac]] + - [[#LinuxMac][Linux/mac]] - [[#Windows][Windows]] 4. [[#Honorable-mentions][Honorable mentions]] * Why use kami From e4f08797277d4feb9058137d8e7c7493ae866f1d Mon Sep 17 00:00:00 2001 From: mrfluffy <53239525+mrfluffy-dev@users.noreply.github.com> Date: Thu, 14 Jul 2022 01:54:16 +0100 Subject: [PATCH 22/22] Fixed spelling mistakes --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index a6cc710..ea29777 100644 --- a/README.org +++ b/README.org @@ -8,7 +8,7 @@ - [[#Windows][Windows]] 4. [[#Honorable-mentions][Honorable mentions]] * Why use kami -well its a fast and easy way to watch anime and read light novels right i your terminal no need to open a browser. +well its a fast and easy way to watch anime and read light novels right in your terminal no need to open a browser. Also rust is fast as fuck boiiiii. * Dependencies 1. [[https://github.com/sharkdp/bat][bat]]