diff --git a/sources/en.manganow/.cargo/config.toml b/sources/en.manganow/.cargo/config.toml new file mode 100644 index 000000000..f137b5a99 --- /dev/null +++ b/sources/en.manganow/.cargo/config.toml @@ -0,0 +1,5 @@ +[build] +target = "wasm32-unknown-unknown" + +[target.wasm32-unknown-unknown] +runner = "aidoku-test-runner" diff --git a/sources/en.manganow/Cargo.lock b/sources/en.manganow/Cargo.lock new file mode 100644 index 000000000..6aed6128f --- /dev/null +++ b/sources/en.manganow/Cargo.lock @@ -0,0 +1,367 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aidoku" +version = "0.3.0" +source = "git+https://github.com/Aidoku/aidoku-rs.git?branch=next#99eeb7e5906160f7c0d21003dd5a7a0b7c6be507" +dependencies = [ + "chrono", + "euclid", + "hashbrown", + "num-traits", + "postcard", + "serde", + "serde_json", + "talc", +] + +[[package]] +name = "aidoku-test" +version = "1.0.0" +source = "git+https://github.com/Aidoku/aidoku-rs.git?branch=next#99eeb7e5906160f7c0d21003dd5a7a0b7c6be507" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "num-traits", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", + "serde", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "manganow" +version = "0.1.0" +dependencies = [ + "aidoku", + "aidoku-test", + "mangareader", +] + +[[package]] +name = "mangareader" +version = "0.1.0" +dependencies = [ + "aidoku", + "serde", + "serde_json", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "serde", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "talc" +version = "4.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ae828aa394de34c7de08f522d1b86bd1c182c668d27da69caadda00590f26d" +dependencies = [ + "lock_api", +] + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/sources/en.manganow/Cargo.toml b/sources/en.manganow/Cargo.toml new file mode 100644 index 000000000..01406af6f --- /dev/null +++ b/sources/en.manganow/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "manganow" +version = "0.1.0" +edition = "2021" + +[dependencies] +aidoku = { git = "https://github.com/Aidoku/aidoku-rs.git", branch = "next", version = "0.3.0" } +mangareader = { path = "../../templates/mangareader" } + +[dev-dependencies] +aidoku = { git = "https://github.com/Aidoku/aidoku-rs.git", branch = "next", features = ["test"] } +aidoku-test = { git = "https://github.com/Aidoku/aidoku-rs.git", branch = "next" } + +[lib] +crate-type = ["cdylib"] + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" +opt-level = "s" +strip = true +lto = true diff --git a/sources/en.manganow/res/filters.json b/sources/en.manganow/res/filters.json new file mode 100644 index 000000000..e0f8f1977 --- /dev/null +++ b/sources/en.manganow/res/filters.json @@ -0,0 +1,171 @@ +[ + { + "id": "sort", + "title": "Sort", + "type": "sort", + "canAscend": false, + "options": [ + "Default", + "Latest Updated", + "Score", + "Name A-Z", + "Release Date", + "Most Viewed" + ] + }, + { + "id": "type", + "title": "Type", + "type": "select", + "options": [ + "All", + "Manga", + "One-shot", + "Doujinshi", + "Light Novel", + "Manhwa", + "Manhua", + "Comic" + ], + "ids": ["", "1", "2", "3", "4", "5", "6", "8"] + }, + { + "id": "status", + "title": "Status", + "type": "select", + "options": [ + "All", + "Finished", + "Publishing", + "On Hiatus", + "Discontinued", + "Not yet published" + ], + "ids": ["", "1", "2", "3", "4", "5"] + }, + { + "id": "score", + "title": "Score", + "type": "select", + "options": [ + "All", + "(1) Apalling", + "(2) Horrible", + "(3) Very Bad", + "(4) Bad", + "(5) Average", + "(6) Fine", + "(7) Good", + "(8) Very Good", + "(9) Great", + "(10) Masterpiece" + ], + "ids": ["", "1", "2", "3", "4", "5", "6", "8", "9", "10"] + }, + { + "id": "genre", + "title": "Genres", + "type": "multi-select", + "isGenre": true, + "options": [ + "Action", + "Adventure", + "Animated", + "Anime", + "Cartoon", + "Comedy", + "Comic", + "Completed", + "Cooking", + "Detective", + "Doujinshi", + "Drama", + "Ecchi", + "Fantasy", + "Gender Bender", + "Harem", + "Historical", + "Horror", + "Isekai", + "Josei", + "Magic", + "Manga", + "Manhua", + "Manhwa", + "Martial Arts", + "Mature", + "Mecha", + "Military", + "Mystery", + "One shot", + "Psychological", + "Reincarnation", + "Romance", + "School Life", + "Sci-fi", + "Seinen", + "Shoujo", + "Shoujo Ai", + "Shounen", + "Shounen Ai", + "Slice of Life", + "Smut", + "Sports", + "Super Power", + "Supernatural", + "Thriller", + "Tragedy", + "Webtoon" + ], + "ids": [ + "1", + "2", + "641", + "375", + "463", + "3", + "200", + "326", + "133", + "386", + "534", + "10", + "41", + "17", + "89", + "11", + "30", + "21", + "70", + "67", + "420", + "137", + "51", + "79", + "12", + "22", + "72", + "1180", + "44", + "721", + "23", + "1603", + "13", + "4", + "24", + "25", + "33", + "123", + "5", + "680", + "14", + "734", + "142", + "28", + "6", + "1816", + "97", + "60" + ] + } +] diff --git a/sources/en.manganow/res/icon.png b/sources/en.manganow/res/icon.png new file mode 100644 index 000000000..e03ba345d Binary files /dev/null and b/sources/en.manganow/res/icon.png differ diff --git a/sources/en.manganow/res/source.json b/sources/en.manganow/res/source.json new file mode 100644 index 000000000..525573378 --- /dev/null +++ b/sources/en.manganow/res/source.json @@ -0,0 +1,31 @@ +{ + "info": { + "id": "en.manganow", + "name": "MangaNow", + "version": 1, + "url": "https://manganow.to", + "contentRating": 1, + "languages": ["en"] + }, + "listings": [ + { + "id": "latest-updated", + "name": "Latest Updated" + }, + { + "id": "new-release", + "name": "New Release" + }, + { + "id": "most-viewed", + "name": "Most Viewed" + }, + { + "id": "completed", + "name": "Completed" + } + ], + "config": { + "hidesFiltersWhileSearching": true + } +} diff --git a/sources/en.manganow/src/lib.rs b/sources/en.manganow/src/lib.rs new file mode 100644 index 000000000..5429cd67a --- /dev/null +++ b/sources/en.manganow/src/lib.rs @@ -0,0 +1,54 @@ +#![no_std] +use aidoku::{alloc::String, prelude::*, DeepLinkResult, Result, Source}; +use mangareader::{Impl, MangaReader, Params}; + +const BASE_URL: &str = "https://manganow.to"; + +struct MangaNow; + +impl Impl for MangaNow { + fn new() -> Self { + Self + } + + fn params(&self) -> Params { + Params { + base_url: BASE_URL.into(), + page_selector: ".container-reader-chapter > .iv-card:not([data-url$=manganow.jpg])" + .into(), + ..Default::default() + } + } + + // same handler as mangabox + fn handle_deep_link(&self, params: &Params, url: String) -> Result> { + let Some(path) = url.strip_prefix(params.base_url.as_ref()) else { + return Ok(None); + }; + + const MANGA_PATH: &str = "manga/"; + if !path.starts_with(MANGA_PATH) { + return Ok(None); + } + + if let Some(idx) = path.rfind("/chapter-") { + // ex: https://manganow.to/manga/i-was-reincarnated-as-an-evil-noble-in-a-game-and-became-unparalleled-with-my-overpowered-muscles/chapter-4 + let manga_key = &path[..idx]; + Ok(Some(DeepLinkResult::Chapter { + manga_key: manga_key.into(), + key: path.into(), + })) + } else { + // ex: https://manganow.to/manga/i-was-reincarnated-as-an-evil-noble-in-a-game-and-became-unparalleled-with-my-overpowered-muscles + Ok(Some(DeepLinkResult::Manga { key: path.into() })) + } + } +} + +register_source!( + MangaReader, + ListingProvider, + Home, + ImageRequestProvider, + DeepLinkHandler +); diff --git a/sources/multi.mangareaderto/.cargo/config.toml b/sources/multi.mangareaderto/.cargo/config.toml new file mode 100644 index 000000000..f137b5a99 --- /dev/null +++ b/sources/multi.mangareaderto/.cargo/config.toml @@ -0,0 +1,5 @@ +[build] +target = "wasm32-unknown-unknown" + +[target.wasm32-unknown-unknown] +runner = "aidoku-test-runner" diff --git a/sources/multi.mangareaderto/Cargo.lock b/sources/multi.mangareaderto/Cargo.lock new file mode 100644 index 000000000..9f6ae3dcd --- /dev/null +++ b/sources/multi.mangareaderto/Cargo.lock @@ -0,0 +1,367 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aidoku" +version = "0.3.0" +source = "git+https://github.com/Aidoku/aidoku-rs.git?branch=next#99eeb7e5906160f7c0d21003dd5a7a0b7c6be507" +dependencies = [ + "chrono", + "euclid", + "hashbrown", + "num-traits", + "postcard", + "serde", + "serde_json", + "talc", +] + +[[package]] +name = "aidoku-test" +version = "1.0.0" +source = "git+https://github.com/Aidoku/aidoku-rs.git?branch=next#99eeb7e5906160f7c0d21003dd5a7a0b7c6be507" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "num-traits", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", + "serde", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "mangareader" +version = "0.1.0" +dependencies = [ + "aidoku", + "serde", + "serde_json", +] + +[[package]] +name = "mangareaderto" +version = "0.1.0" +dependencies = [ + "aidoku", + "aidoku-test", + "mangareader", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "serde", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "talc" +version = "4.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ae828aa394de34c7de08f522d1b86bd1c182c668d27da69caadda00590f26d" +dependencies = [ + "lock_api", +] + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/sources/multi.mangareaderto/Cargo.toml b/sources/multi.mangareaderto/Cargo.toml new file mode 100644 index 000000000..0276843b7 --- /dev/null +++ b/sources/multi.mangareaderto/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "mangareaderto" +version = "0.1.0" +edition = "2021" + +[dependencies] +aidoku = { git = "https://github.com/Aidoku/aidoku-rs.git", branch = "next", version = "0.3.0" } +mangareader = { path = "../../templates/mangareader" } + +[dev-dependencies] +aidoku = { git = "https://github.com/Aidoku/aidoku-rs.git", branch = "next", features = ["test"] } +aidoku-test = { git = "https://github.com/Aidoku/aidoku-rs.git", branch = "next" } + +[lib] +crate-type = ["cdylib"] + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" +opt-level = "s" +strip = true +lto = true diff --git a/sources/multi.mangareaderto/res/filters.json b/sources/multi.mangareaderto/res/filters.json new file mode 100644 index 000000000..ac6754a26 --- /dev/null +++ b/sources/multi.mangareaderto/res/filters.json @@ -0,0 +1,180 @@ +[ + { + "id": "sort", + "title": "Sort", + "type": "sort", + "canAscend": false, + "options": [ + "Default", + "Latest Updated", + "Score", + "Name A-Z", + "Release Date", + "Most Viewed" + ] + }, + { + "id": "type", + "title": "Type", + "type": "select", + "options": [ + "All", + "Manga", + "One-shot", + "Doujinshi", + "Light Novel", + "Manhwa", + "Manhua", + "Comic" + ], + "ids": ["", "1", "2", "3", "4", "5", "6", "8"] + }, + { + "id": "status", + "title": "Status", + "type": "select", + "options": [ + "All", + "Finished", + "Publishing", + "On Hiatus", + "Discontinued", + "Not yet published" + ], + "ids": ["", "1", "2", "3", "4", "5"] + }, + { + "id": "rating_type", + "title": "Rating Type", + "type": "select", + "options": [ + "All", + "G - All Ages", + "PG - Children", + "PG-13 - Teens 13 or older", + "R - 17+ (violence & profanity)", + "R+ - Mild Nudity", + "Rx - Hentai" + ], + "ids": ["", "1", "2", "3", "4", "5", "6"] + }, + { + "id": "score", + "title": "Score", + "type": "select", + "options": [ + "All", + "(1) Apalling", + "(2) Horrible", + "(3) Very Bad", + "(4) Bad", + "(5) Average", + "(6) Fine", + "(7) Good", + "(8) Very Good", + "(9) Great", + "(10) Masterpiece" + ], + "ids": ["", "1", "2", "3", "4", "5", "6", "8", "9", "10"] + }, + { + "id": "genre", + "title": "Genres", + "type": "multi-select", + "isGenre": true, + "options": [ + "Action", + "Adventure", + "Cars", + "Comedy", + "Dementia", + "Demons", + "Doujinshi", + "Drama", + "Ecchi", + "Fantasy", + "Game", + "Gender Bender", + "Harem", + "Hentai", + "Historical", + "Horror", + "Josei", + "Kids", + "Magic", + "Martial Arts", + "Mecha", + "Military", + "Music", + "Mystery", + "Parody", + "Police", + "Psychological", + "Romance", + "Samurai", + "School", + "Sci-Fi", + "Seinen", + "Shoujo", + "Shoujo Ai", + "Shounen", + "Shounen Ai", + "Slice of Life", + "Space", + "Sports", + "Super Power", + "Supernatural", + "Thriller", + "Vampire", + "Yaoi", + "Yuri" + ], + "ids": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "19", + "20", + "21", + "22", + "23", + "24", + "25", + "26", + "27", + "28", + "29", + "30", + "31", + "32", + "33", + "34", + "35", + "36", + "37", + "38", + "39", + "40", + "41", + "42", + "43", + "44", + "45" + ] + } +] diff --git a/sources/multi.mangareaderto/res/icon.png b/sources/multi.mangareaderto/res/icon.png new file mode 100644 index 000000000..311cd3ff2 Binary files /dev/null and b/sources/multi.mangareaderto/res/icon.png differ diff --git a/sources/multi.mangareaderto/res/source.json b/sources/multi.mangareaderto/res/source.json new file mode 100644 index 000000000..b22fc84e9 --- /dev/null +++ b/sources/multi.mangareaderto/res/source.json @@ -0,0 +1,31 @@ +{ + "info": { + "id": "multi.mangareader", + "name": "MangaReader", + "version": 1, + "url": "https://mangareader.to", + "contentRating": 1, + "languages": ["en", "es", "fr", "ja", "ko", "pt-br", "zh"] + }, + "listings": [ + { + "id": "latest-updated", + "name": "Latest Updated" + }, + { + "id": "new-release", + "name": "New Release" + }, + { + "id": "most-viewed", + "name": "Most Viewed" + }, + { + "id": "completed", + "name": "Completed" + } + ], + "config": { + "hidesFiltersWhileSearching": true + } +} diff --git a/sources/multi.mangareaderto/src/lib.rs b/sources/multi.mangareaderto/src/lib.rs new file mode 100644 index 000000000..ff67f9862 --- /dev/null +++ b/sources/multi.mangareaderto/src/lib.rs @@ -0,0 +1,87 @@ +#![no_std] +use aidoku::{ + alloc::{String, Vec}, + canvas::Rect, + imports::{canvas::Canvas, defaults::defaults_get}, + prelude::*, + Result, Source, +}; +use mangareader::{Impl, MangaReader, Params}; + +const BASE_URL: &str = "https://mangareader.to"; + +struct MangaReaderTo; + +impl Impl for MangaReaderTo { + fn new() -> Self { + Self + } + + fn params(&self) -> Params { + Params { + base_url: BASE_URL.into(), + page_selector: ".iv-card".into(), + get_chapter_selector: || { + defaults_get::>("languages") + .map(|langs| { + langs + .iter() + .map(|lang| format!("#{lang}-chapters > li")) + .collect::>() + .join(", ") + .into() + }) + .unwrap_or_else(|| "#en-chapters > li".into()) + }, + get_chapter_language: |element| { + element + .parent() + .map(|p| match p.id().unwrap_or_default().as_str() { + "en-chapters" => "en", + "ja-chapters" => "ja", + _ => "en", + }) + .map(|lang| lang.into()) + .unwrap_or_else(|| "en".into()) + }, + get_page_url_path: |chapter_id| { + format!("/ajax/image/list/chap/{chapter_id}?mode=vertical") + }, + ..Default::default() + } + } + + fn process_page_image( + &self, + _params: &Params, + response: aidoku::ImageResponse, + context: Option, + ) -> Result { + if response.code == 404 { + bail!("Missing image"); + } + + let shuffled = context.is_some_and(|c| c.get("shuffled").is_some()); + if !shuffled { + return Ok(response.image); + }; + + let width = response.image.width(); + let height = response.image.height(); + + let mut canvas = Canvas::new(width, height); + + let img_rect = Rect::new(0.0, 0.0, width, height); + canvas.draw_image(&response.image, img_rect); + + Ok(canvas.get_image()) + } +} + +register_source!( + MangaReader, + ListingProvider, + Home, + DeepLinkHandler, + PageImageProcessor +);