live-probed: /stalk/genshin was NOT real — it just pass-through the raw SvelteKit __data.json (only nickname/level/nameCardId/profilePicture), not a full Genshin profile like the Shirokami source (which parses characters/element/costume/stats via enka-network-api -> get_profile_for_uid). That proper API is now 404 without an enka token. Removed. stalk now has 3 real endpoints: github, youtube, twitter.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//! Infrastructure — Stalk utilities (github, youtube, genshin, twitter).
|
||||
//! Infrastructure — Stalk utilities (github, youtube, twitter).
|
||||
//!
|
||||
//! Ported from Shirokami-API `scraper/stalk/*.js`.
|
||||
|
||||
@@ -417,33 +417,6 @@ fn video_from_grid_video(gv: &Value) -> Value {
|
||||
v
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Genshin Impact — enka.network public API
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
pub async fn fetch_genshin_stalk(user_id: &str) -> Result<Value, String> {
|
||||
let url = format!("https://enka.network/u/{}/__data.json", user_id);
|
||||
let resp = http_client()
|
||||
.client()
|
||||
.get(&url)
|
||||
.header(
|
||||
USER_AGENT,
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0 Safari/537.36",
|
||||
)
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| format!("HTTP: {}", e))?;
|
||||
if resp.status() == reqwest::StatusCode::NOT_FOUND {
|
||||
return Err("User tidak ditemukan".into());
|
||||
}
|
||||
if !resp.status().is_success() {
|
||||
return Err(format!("HTTP {}", resp.status()));
|
||||
}
|
||||
let data: Value = resp.json().await.map_err(|e| format!("JSON: {}", e))?;
|
||||
// Pass through the raw JSON (Enka __data.json is already structured).
|
||||
Ok(data)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Twitter — fxtwitter API
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user