chore: scraping user data becomes impossible
This commit is contained in:
@@ -6,12 +6,9 @@ edition = "2024"
|
||||
license = "GPL-3.0"
|
||||
|
||||
[features]
|
||||
default = ["compio", "bincode"]
|
||||
default = ["compio"]
|
||||
compio = ["dep:compio"]
|
||||
tokio = ["dep:tokio"]
|
||||
bincode = ["dep:bincode"]
|
||||
|
||||
parquet = ['dep:parquet', 'dep:parquet_derive']
|
||||
|
||||
[dependencies]
|
||||
snafu = { workspace = true }
|
||||
@@ -45,7 +42,3 @@ flate2 = "1.1.2"
|
||||
cbc = { version = "0.1.2", features = ["alloc"] }
|
||||
aes = "0.8.4"
|
||||
cipher = { version = "0.4.4", features = ["block-padding"] }
|
||||
bincode = { version = "2.0.1", optional = true }
|
||||
|
||||
parquet = { workspace = true, optional = true }
|
||||
parquet_derive = { workspace = true, optional = true }
|
||||
|
||||
@@ -7,8 +7,5 @@ pub mod helper;
|
||||
mod error;
|
||||
pub use error::ApiError;
|
||||
|
||||
#[cfg(feature = "bincode")]
|
||||
pub use bincode;
|
||||
|
||||
#[cfg(all(feature = "compio", feature = "tokio"))]
|
||||
compile_error!("you must not enable both `compio` and `tokio`");
|
||||
|
||||
@@ -16,7 +16,6 @@ pub struct GetUserMusicApi {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GetUserMusicApiResp {
|
||||
pub user_id: u32,
|
||||
@@ -25,7 +24,6 @@ pub struct GetUserMusicApiResp {
|
||||
pub user_music_list: Vec<UserMusic>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UserMusic {
|
||||
@@ -33,7 +31,6 @@ pub struct UserMusic {
|
||||
pub length: u32,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UserMusicDetail {
|
||||
@@ -85,21 +82,6 @@ pub struct UserMusicDetail {
|
||||
pub ext_num2: i64,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "parquet", derive(parquet_derive::ParquetRecordWriter))]
|
||||
pub struct UserMusicDetailFlatten {
|
||||
pub user_id: u32,
|
||||
pub music_id: u32,
|
||||
pub level: u8,
|
||||
pub play_count: u32,
|
||||
pub achievement: u32,
|
||||
pub combo_status: u8,
|
||||
pub sync_status: u8,
|
||||
pub deluxscore_max: u16,
|
||||
pub score_rank: u8,
|
||||
pub ext_num1: u32,
|
||||
pub ext_num2: u32,
|
||||
}
|
||||
|
||||
impl Display for UserMusicDetail {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
if let Some(music_title) = query_music(self.music_id).map(|i| &i.name) {
|
||||
@@ -149,35 +131,3 @@ impl Display for UserMusicDetail {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl UserMusicDetailFlatten {
|
||||
pub fn new(
|
||||
user_id: u32,
|
||||
UserMusicDetail {
|
||||
music_id,
|
||||
level,
|
||||
play_count,
|
||||
achievement,
|
||||
combo_status,
|
||||
sync_status,
|
||||
deluxscore_max,
|
||||
score_rank,
|
||||
ext_num1,
|
||||
ext_num2,
|
||||
}: UserMusicDetail,
|
||||
) -> Self {
|
||||
Self {
|
||||
user_id,
|
||||
music_id,
|
||||
level: level as _,
|
||||
sync_status: sync_status as _,
|
||||
deluxscore_max: deluxscore_max as _,
|
||||
score_rank: score_rank as _,
|
||||
play_count: play_count as _,
|
||||
achievement: achievement as _,
|
||||
combo_status: combo_status as _,
|
||||
ext_num1: ext_num1 as _,
|
||||
ext_num2: ext_num2 as _,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ impl Default for GetUserPreviewApi {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[cfg_attr(feature = "parquet", derive(parquet_derive::ParquetRecordWriter))]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GetUserPreviewApiResp {
|
||||
pub user_id: u32,
|
||||
|
||||
@@ -19,7 +19,6 @@ impl From<u32> for GetUserRatingApi {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GetUserRatingApiResp {
|
||||
@@ -27,7 +26,6 @@ pub struct GetUserRatingApiResp {
|
||||
pub user_rating: UserRating,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UserRating {
|
||||
@@ -44,7 +42,6 @@ pub struct UserRating {
|
||||
pub udemae: Udemae,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MusicRating {
|
||||
@@ -66,18 +63,6 @@ pub struct MusicRating {
|
||||
pub achievement: i32,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "parquet", derive(parquet_derive::ParquetRecordWriter))]
|
||||
#[derive(Default, Debug, Clone, PartialEq)]
|
||||
pub struct MusicRatingFlatten {
|
||||
pub user_id: u32,
|
||||
pub music_id: u32,
|
||||
pub level: u32,
|
||||
pub rom_version: i64,
|
||||
pub achievement: i32,
|
||||
pub dx_rating: u32,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Udemae {
|
||||
|
||||
@@ -12,44 +12,6 @@ impl From<u32> for GetUserRegionApi {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<GetUserRegionApiResp> for Vec<UserRegionFlatten> {
|
||||
fn from(
|
||||
GetUserRegionApiResp {
|
||||
user_id,
|
||||
user_region_list,
|
||||
..
|
||||
}: GetUserRegionApiResp,
|
||||
) -> Self {
|
||||
user_region_list
|
||||
.into_iter()
|
||||
.map(
|
||||
|UserRegion {
|
||||
region_id,
|
||||
play_count,
|
||||
created,
|
||||
}| {
|
||||
UserRegionFlatten {
|
||||
user_id,
|
||||
region_id,
|
||||
play_count,
|
||||
created,
|
||||
}
|
||||
},
|
||||
)
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "parquet", derive(parquet_derive::ParquetRecordWriter))]
|
||||
pub struct UserRegionFlatten {
|
||||
pub user_id: u32,
|
||||
pub region_id: u32,
|
||||
pub play_count: i64,
|
||||
pub created: String,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GetUserRegionApiResp {
|
||||
@@ -58,7 +20,6 @@ pub struct GetUserRegionApiResp {
|
||||
pub user_region_list: Vec<UserRegion>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "bincode", derive(bincode::Encode, bincode::Decode))]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UserRegion {
|
||||
|
||||
@@ -18,20 +18,15 @@ pub use get_user_rating_api::{
|
||||
GetUserRatingApi,
|
||||
GetUserRatingApiResp, // api
|
||||
MusicRating,
|
||||
MusicRatingFlatten,
|
||||
Udemae,
|
||||
UserRating,
|
||||
};
|
||||
|
||||
mod get_user_music_api;
|
||||
pub use get_user_music_api::{
|
||||
GetUserMusicApi, GetUserMusicApiResp, UserMusic, UserMusicDetail, UserMusicDetailFlatten,
|
||||
};
|
||||
pub use get_user_music_api::{GetUserMusicApi, GetUserMusicApiResp, UserMusic, UserMusicDetail};
|
||||
|
||||
mod get_user_region_api;
|
||||
pub use get_user_region_api::{
|
||||
GetUserRegionApi, GetUserRegionApiResp, UserRegion, UserRegionFlatten,
|
||||
};
|
||||
pub use get_user_region_api::{GetUserRegionApi, GetUserRegionApiResp, UserRegion};
|
||||
|
||||
mod dxrating;
|
||||
pub use dxrating::{
|
||||
|
||||
@@ -32,7 +32,7 @@ impl Default for UserLogoutApi {
|
||||
client_id: "A63E01C2805".into(),
|
||||
type_: 1,
|
||||
access_code: "",
|
||||
|
||||
|
||||
login_date_time: 0,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user