fix(komik): keep api.komiku.org for lists, source genre-list from komiku.org root
Deploy Scraper / build-and-deploy (push) Canceled after 0s
Deploy Scraper / build-and-deploy (push) Canceled after 0s
Blanket-switching the whole komik module to komiku.org broke the manga list: komiku.org/manga/?tipe=manga 301-redirects to /pustaka/ (the new library layout, 0 .bge items), while api.komiku.org/manga/?tipe=manga serves the .bge grid the parser expects unredirected. Correct split: - api_url() = api.komiku.org -> manga/manhua/manhwa/genre/search lists (.bge layout) - genre_list fetches base_url() = komiku.org root, which is POPULATED (#Genre .ls3 .ls3p h4 + /genre/<slug>/ links) — api.komiku.org root is empty Reverts the api_url() half of a46adf1; keeps the underlying insight that the genre-list needs the populated komiku.org root.
This commit is contained in:
@@ -49,7 +49,7 @@ impl KomikUseCases {
|
||||
.get_or_set("komik:genres:list:v3", GENRE_LIST_CACHE_TTL, || async {
|
||||
let html = self
|
||||
.repository
|
||||
.fetch_html(&self.repository.api_url())
|
||||
.fetch_html(&self.repository.base_url())
|
||||
.await
|
||||
.map_err(|e| e.to_string())?;
|
||||
let genres = tokio::task::spawn_blocking(move || parser::parse_genres(&html))
|
||||
|
||||
@@ -21,13 +21,14 @@ pub fn get_production_url() -> String {
|
||||
|
||||
/// Get Komik API URL from environment config.
|
||||
///
|
||||
/// Defaults to `https://komiku.org` (NOT the legacy `api.komiku.org`): the
|
||||
/// `api.komiku.org` root returns an empty body (site-side), which broke the
|
||||
/// komik genre-list endpoint. `komiku.org` serves identical sub-path content
|
||||
/// (manga lists, genre, search) plus a populated root, so the module is
|
||||
/// consolidated onto the canonical, working domain.
|
||||
/// Defaults to `https://api.komiku.org`. This is the API mirror whose
|
||||
/// sub-paths (`/manga/?tipe=manga`, `/genre/<slug>/`, `/search/<q>/`) serve
|
||||
/// the `.bge` grid layout the parsers expect. NOTE: `api.komiku.org`'s ROOT
|
||||
/// path returns an empty body — the komik genre-list endpoint must therefore
|
||||
/// fetch from `komiku.org` (base URL) instead of this root (see
|
||||
/// `KomikUseCase::genre_list`, which uses `base_url()`).
|
||||
pub fn get_komik_api_url() -> String {
|
||||
env::var("KOMIK2_API_URL").unwrap_or_else(|_| "https://komiku.org".to_string())
|
||||
env::var("KOMIK2_API_URL").unwrap_or_else(|_| "https://api.komiku.org".to_string())
|
||||
}
|
||||
|
||||
/// Get Otakudesu URL from environment config.
|
||||
|
||||
Reference in New Issue
Block a user