diff --git a/Cargo.lock b/Cargo.lock index e82a4f6..87bc60b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1491,6 +1491,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls", "serde", "serde_json", "serde_urlencoded", @@ -1505,6 +1506,20 @@ dependencies = [ "winreg", ] +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + [[package]] name = "royal_road_archiver" version = "0.1.0" @@ -1544,6 +1559,28 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ryu" version = "1.0.16" @@ -1590,6 +1627,16 @@ dependencies = [ "tendril", ] +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "security-framework" version = "2.9.2" @@ -1737,6 +1784,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2015,6 +2068,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "upon" version = "0.7.1" diff --git a/Cargo.toml b/Cargo.toml index ebfbe70..857c866 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ html2md = "0.2.14" indicatif = "0.17.7" path-slash = "0.2.1" regex = "1.10.3" -reqwest = { version = "0.11.23", features = ["blocking"] } +reqwest = { version = "0.11.23", features = ["blocking", "rustls"] } scraper = "0.18.1" serde_json = "1.0.111" tempdir = "0.3.7" diff --git a/src/file_system_crap.rs b/src/file_system_crap.rs index 300f6e9..0f48e2d 100644 --- a/src/file_system_crap.rs +++ b/src/file_system_crap.rs @@ -75,6 +75,9 @@ pub fn setup_html2xhtml() -> TempDir { #[cfg(target_os = "macos")] { // TODO! // You can find the macos tempdir by doing: echo $TMPDIR + + eprint!("Error! This mode does not currently support MacOS. Try either html mode or markdown mode."); + exit(1); } } diff --git a/src/library.rs b/src/library.rs index 51c13e5..7d3328e 100644 --- a/src/library.rs +++ b/src/library.rs @@ -65,13 +65,6 @@ pub fn generate_audiobook(audiobook_args: AudiobookArgs, book_url: Url, output_d /// This function DOES NOT do any error checking on the Url or output directory & WILL panic if they are wrong. /// Make sure the Url is valid and the output directory is writable BEFORE passing them to this. pub fn generate_epub(epub_args: EpubArgs, book_url: Url, output_directory: PathBuf) { - // Until xhtml is working on MacOS this notice & exit code will remain. - // See file_system_crap::setup_html2xhtml() for current status on MacOS support for this mode. - #[cfg(target_os = "macos")] { - eprint!("Error! This mode does not currently support MacOS. Try either html mode or markdown mode."); - exit(1); - } - let book = book::Book::new(book_url); // Initialize the epub builder.