diff --git a/src/application/komik/use_cases.rs b/src/application/komik/use_cases.rs index 88bb5ec..1ed0217 100644 --- a/src/application/komik/use_cases.rs +++ b/src/application/komik/use_cases.rs @@ -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)) diff --git a/src/infrastructure/scraping/scraping_urls.rs b/src/infrastructure/scraping/scraping_urls.rs index 3548b01..e78a43d 100644 --- a/src/infrastructure/scraping/scraping_urls.rs +++ b/src/infrastructure/scraping/scraping_urls.rs @@ -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//`, `/search//`) 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.