feat: dump user regions

This commit is contained in:
mokurin000
2025-08-03 20:00:50 +08:00
parent ca81c6495a
commit 90a3fc09df
3 changed files with 9 additions and 0 deletions

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@
/players*.json*
/b50*.json*
/region*.json*
/.python-version
/uv.lock

View File

@@ -119,6 +119,8 @@ pub enum Commands {
ListAllUserDump {},
#[cfg(feature = "fetchall")]
ScrapeAllB50Dump {},
#[cfg(feature = "fetchall")]
ScrapeAllRegionDump {},
Logout {
#[arg(short, long)]

View File

@@ -321,6 +321,12 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
dump_cache::<GetUserRatingApiResp>("b50.json", B50)?;
}
#[cfg(feature = "fetchall")]
Commands::ScrapeAllRegionDump {} => {
use crate::{cache::REGIONS, utils::helpers::dump_cache};
dump_cache::<GetUserRatingApiResp>("region.json", REGIONS)?;
}
Commands::Userdata { user_id } => {
let action = async |_| match Sdgb1_50::request::<_, GetUserDataApiResp>(