feat(stalk): add mobile-legends, free-fire, genshin, twitter, tiktok, instagram
Ported from Shirokami-API scraper/stalk/*.js: - /stalk/mobile-legends (gempaytopup CSRF+POST) - /stalk/free-fire (freefirecommunity API + field transform) - /stalk/genshin-impact (enka.network __data.json) - /stalk/twitter (fxtwitter API) - /stalk/tiktok (rehydration JSON parse) - /stalk/instagram (mollygram HTML scrape) Upstream status: twitter/genshin verified working live (elonmusk 241M followers). github+youtube verified earlier. tiktok WAF-blocked, instagram mollygram-captcha blocked, mobile-legends gempaytopup changed POST->GET+JS (all upstream dead for VPS IP; code faithful to source).
This commit is contained in:
@@ -42,3 +42,76 @@ pub async fn youtube_handler(
|
||||
let result = use_cases::youtube(&username).await?;
|
||||
Ok((StatusCode::OK, Json(result)))
|
||||
}
|
||||
|
||||
/// GET /stalk/mobile-legends?user_id=...&zone_id=... (aliases: userid, zoneid)
|
||||
pub async fn mobile_legends_handler(
|
||||
Query(params): Query<StalkParams>,
|
||||
) -> Result<(StatusCode, Json<Value>), AppError> {
|
||||
let user_id = params
|
||||
.user_id
|
||||
.or(params.userid)
|
||||
.ok_or_else(|| AppError::BadRequest("Missing 'user_id' parameter".to_string()))?;
|
||||
let zone_id = params
|
||||
.zone_id
|
||||
.or(params.zoneid)
|
||||
.ok_or_else(|| AppError::BadRequest("Missing 'zone_id' parameter".to_string()))?;
|
||||
let result = use_cases::mobile_legends(&user_id, &zone_id).await?;
|
||||
Ok((StatusCode::OK, Json(result)))
|
||||
}
|
||||
|
||||
/// GET /stalk/free-fire?user_id=... (alias: userid)
|
||||
pub async fn free_fire_handler(
|
||||
Query(params): Query<StalkParams>,
|
||||
) -> Result<(StatusCode, Json<Value>), AppError> {
|
||||
let user_id = params
|
||||
.user_id
|
||||
.or(params.userid)
|
||||
.ok_or_else(|| AppError::BadRequest("Missing 'user_id' parameter".to_string()))?;
|
||||
let result = use_cases::free_fire(&user_id).await?;
|
||||
Ok((StatusCode::OK, Json(result)))
|
||||
}
|
||||
|
||||
/// GET /stalk/genshin-impact?user_id=... (alias: userid)
|
||||
pub async fn genshin_handler(
|
||||
Query(params): Query<StalkParams>,
|
||||
) -> Result<(StatusCode, Json<Value>), AppError> {
|
||||
let user_id = params
|
||||
.user_id
|
||||
.or(params.userid)
|
||||
.ok_or_else(|| AppError::BadRequest("Missing 'user_id' parameter".to_string()))?;
|
||||
let result = use_cases::genshin(&user_id).await?;
|
||||
Ok((StatusCode::OK, Json(result)))
|
||||
}
|
||||
|
||||
/// GET /stalk/twitter?username=...
|
||||
pub async fn twitter_handler(
|
||||
Query(params): Query<StalkParams>,
|
||||
) -> Result<(StatusCode, Json<Value>), AppError> {
|
||||
let username = params
|
||||
.username
|
||||
.ok_or_else(|| AppError::BadRequest("Missing 'username' parameter".to_string()))?;
|
||||
let result = use_cases::twitter(&username).await?;
|
||||
Ok((StatusCode::OK, Json(result)))
|
||||
}
|
||||
|
||||
/// GET /stalk/tiktok?username=...
|
||||
pub async fn tiktok_handler(
|
||||
Query(params): Query<StalkParams>,
|
||||
) -> Result<(StatusCode, Json<Value>), AppError> {
|
||||
let username = params
|
||||
.username
|
||||
.ok_or_else(|| AppError::BadRequest("Missing 'username' parameter".to_string()))?;
|
||||
let result = use_cases::tiktok(&username).await?;
|
||||
Ok((StatusCode::OK, Json(result)))
|
||||
}
|
||||
|
||||
/// GET /stalk/instagram?username=...
|
||||
pub async fn instagram_handler(
|
||||
Query(params): Query<StalkParams>,
|
||||
) -> Result<(StatusCode, Json<Value>), AppError> {
|
||||
let username = params
|
||||
.username
|
||||
.ok_or_else(|| AppError::BadRequest("Missing 'username' parameter".to_string()))?;
|
||||
let result = use_cases::instagram(&username).await?;
|
||||
Ok((StatusCode::OK, Json(result)))
|
||||
}
|
||||
|
||||
@@ -282,6 +282,30 @@ pub fn build_router(app_state: Arc<AppState>) -> anyhow::Result<Router> {
|
||||
"/stalk/youtube",
|
||||
axum::routing::get(crate::presentation::handler::stalk::youtube_handler),
|
||||
)
|
||||
.route(
|
||||
"/stalk/mobile-legends",
|
||||
axum::routing::get(crate::presentation::handler::stalk::mobile_legends_handler),
|
||||
)
|
||||
.route(
|
||||
"/stalk/free-fire",
|
||||
axum::routing::get(crate::presentation::handler::stalk::free_fire_handler),
|
||||
)
|
||||
.route(
|
||||
"/stalk/genshin-impact",
|
||||
axum::routing::get(crate::presentation::handler::stalk::genshin_handler),
|
||||
)
|
||||
.route(
|
||||
"/stalk/twitter",
|
||||
axum::routing::get(crate::presentation::handler::stalk::twitter_handler),
|
||||
)
|
||||
.route(
|
||||
"/stalk/tiktok",
|
||||
axum::routing::get(crate::presentation::handler::stalk::tiktok_handler),
|
||||
)
|
||||
.route(
|
||||
"/stalk/instagram",
|
||||
axum::routing::get(crate::presentation::handler::stalk::instagram_handler),
|
||||
)
|
||||
// Weebs routes
|
||||
.route(
|
||||
"/weebs/anime-info",
|
||||
|
||||
Reference in New Issue
Block a user