feat(stalk): add github + youtube profile stalk endpoints
Ported from Shirokami-API scraper/stalk/{github,youtube}.js:
- /stalk/github (GitHub public API profile)
- /stalk/youtube (ytInitialData parse from /videos subpage:
handles lockupViewModel (new), videoRenderer, gridVideoRenderer,
shortsLockupViewModel; channel metadata + top-5 videos)
Also fix misc harga-emas main price to smallest-gram (1gr).
This commit is contained in:
1 parent
6df8af54eb
commit
242e3498fe
7 files changed
+478
No files matched your search
@@ -4,3 +4,4 @@ pub mod downloader;
|
||||
pub mod komik;
|
||||
pub mod misc;
|
||||
pub mod proxy;
|
||||
pub mod stalk;
|
||||
@@ -0,0 +1,19 @@
|
||||
//! Application use-cases for stalk (profile/user lookups).
|
||||
|
||||
use crate::domain::error::ScrapingError;
|
||||
use crate::infrastructure::repository::stalk as Repo;
|
||||
use serde_json::Value;
|
||||
|
||||
/// GitHub user profile stalk.
|
||||
pub async fn github(username: &str) -> Result<Value, ScrapingError> {
|
||||
Repo::fetch_github_stalk(username)
|
||||
.await
|
||||
.map_err(ScrapingError::Http)
|
||||
}
|
||||
|
||||
/// YouTube channel/profile stalk.
|
||||
pub async fn youtube(username: &str) -> Result<Value, ScrapingError> {
|
||||
Repo::fetch_youtube_stalk(username)
|
||||
.await
|
||||
.map_err(ScrapingError::Http)
|
||||
}
|
||||
Reference in new issue
Block a user