fix: remove serde_with json feature
This commit is contained in:
parent
1a22dc835a
commit
596b9c4d4a
6 changed files with 19 additions and 19 deletions
|
|
@ -44,8 +44,8 @@ tokio = { version = "1.20.0", features = ["macros", "time"] }
|
|||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0.82"
|
||||
serde_with = { version = "3.0.0", default-features = false, features = [
|
||||
"alloc",
|
||||
"macros",
|
||||
"json",
|
||||
] }
|
||||
serde_plain = "1.0.1"
|
||||
rand = "0.8.5"
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ use serde::{
|
|||
de::{IgnoredAny, Visitor},
|
||||
Deserialize,
|
||||
};
|
||||
use serde_with::{json::JsonString, serde_as, VecSkipError};
|
||||
use serde_with::{serde_as, DisplayFromStr, VecSkipError};
|
||||
|
||||
use crate::error::ExtractionError;
|
||||
use crate::serializer::{text::Text, MapResult, VecSkipErrorWrap};
|
||||
|
|
@ -202,7 +202,7 @@ pub(crate) struct ResponseContext {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct Continuation {
|
||||
/// Number of search results
|
||||
#[serde_as(as = "Option<JsonString>")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
pub estimated_results: Option<u64>,
|
||||
#[serde(
|
||||
alias = "onResponseReceivedCommands",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::ops::Range;
|
|||
|
||||
use serde::Deserialize;
|
||||
use serde_with::serde_as;
|
||||
use serde_with::{json::JsonString, DefaultOnError};
|
||||
use serde_with::{DefaultOnError, DisplayFromStr};
|
||||
|
||||
use super::{ResponseContext, Thumbnails};
|
||||
use crate::serializer::{text::Text, MapResult};
|
||||
|
|
@ -78,7 +78,7 @@ pub(crate) struct ErrorMessage {
|
|||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct StreamingData {
|
||||
#[serde_as(as = "JsonString")]
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub expires_in_seconds: u32,
|
||||
#[serde(default)]
|
||||
pub formats: MapResult<Vec<Format>>,
|
||||
|
|
@ -106,7 +106,7 @@ pub(crate) struct Format {
|
|||
|
||||
pub width: Option<u32>,
|
||||
pub height: Option<u32>,
|
||||
#[serde_as(as = "Option<JsonString>")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
pub approx_duration_ms: Option<u32>,
|
||||
|
||||
#[serde_as(as = "Option<crate::serializer::Range>")]
|
||||
|
|
@ -114,7 +114,7 @@ pub(crate) struct Format {
|
|||
#[serde_as(as = "Option<crate::serializer::Range>")]
|
||||
pub init_range: Option<Range<u32>>,
|
||||
|
||||
#[serde_as(as = "Option<JsonString>")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
pub content_length: Option<u64>,
|
||||
|
||||
#[serde(default)]
|
||||
|
|
@ -129,7 +129,7 @@ pub(crate) struct Format {
|
|||
#[serde(default)]
|
||||
#[serde_as(deserialize_as = "DefaultOnError")]
|
||||
pub audio_quality: Option<AudioQuality>,
|
||||
#[serde_as(as = "Option<JsonString>")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
pub audio_sample_rate: Option<u32>,
|
||||
pub audio_channels: Option<u8>,
|
||||
pub loudness_db: Option<f32>,
|
||||
|
|
@ -237,7 +237,7 @@ pub(crate) struct CaptionTrack {
|
|||
pub(crate) struct VideoDetails {
|
||||
pub video_id: String,
|
||||
pub title: String,
|
||||
#[serde_as(as = "JsonString")]
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub length_seconds: u32,
|
||||
#[serde(default)]
|
||||
pub keywords: Vec<String>,
|
||||
|
|
@ -245,7 +245,7 @@ pub(crate) struct VideoDetails {
|
|||
pub short_description: Option<String>,
|
||||
#[serde(default)]
|
||||
pub thumbnail: Thumbnails,
|
||||
#[serde_as(as = "JsonString")]
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub view_count: u64,
|
||||
pub author: String,
|
||||
pub is_live_content: bool,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use serde::{
|
|||
de::{IgnoredAny, Visitor},
|
||||
Deserialize,
|
||||
};
|
||||
use serde_with::{json::JsonString, serde_as};
|
||||
use serde_with::{serde_as, DisplayFromStr};
|
||||
|
||||
use super::{video_item::YouTubeListRendererWrap, ResponseContext};
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ use super::{video_item::YouTubeListRendererWrap, ResponseContext};
|
|||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct Search {
|
||||
#[serde_as(as = "Option<JsonString>")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
pub estimated_results: Option<u64>,
|
||||
pub contents: Contents,
|
||||
pub response_context: ResponseContext,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use once_cell::sync::Lazy;
|
|||
use regex::Regex;
|
||||
use serde::Deserialize;
|
||||
use serde_with::{
|
||||
json::JsonString, rust::deserialize_ignore_any, serde_as, DefaultOnError, VecSkipError,
|
||||
rust::deserialize_ignore_any, serde_as, DefaultOnError, DisplayFromStr, VecSkipError,
|
||||
};
|
||||
use time::OffsetDateTime;
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ pub(crate) struct PlaylistVideoRenderer {
|
|||
pub title: String,
|
||||
#[serde(rename = "shortBylineText")]
|
||||
pub channel: TextComponent,
|
||||
#[serde_as(as = "Option<JsonString>")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
pub length_seconds: Option<u32>,
|
||||
/// Regular video: `["29K views", " • ", "13 years ago"]`
|
||||
/// Livestream: `["66K", " watching"]`
|
||||
|
|
@ -192,7 +192,7 @@ pub(crate) struct PlaylistRenderer {
|
|||
/// The first item of this list contains the playlist thumbnail,
|
||||
/// subsequent items contain very small thumbnails of the next playlist videos
|
||||
pub thumbnails: Option<Vec<Thumbnails>>,
|
||||
#[serde_as(as = "Option<JsonString>")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
pub video_count: Option<u64>,
|
||||
#[serde_as(as = "Option<Text>")]
|
||||
pub video_count_short_text: Option<String>,
|
||||
|
|
@ -248,7 +248,7 @@ pub(crate) struct YouTubeListRenderer {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub(crate) struct UpcomingEventData {
|
||||
/// Unixtime in seconds
|
||||
#[serde_as(as = "JsonString")]
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub start_time: i64,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use serde_with::{json::JsonString, serde_as, DeserializeAs, SerializeAs};
|
||||
use serde_with::{serde_as, DeserializeAs, DisplayFromStr, SerializeAs};
|
||||
|
||||
#[serde_as]
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Range {
|
||||
#[serde_as(as = "JsonString")]
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
start: u32,
|
||||
#[serde_as(as = "JsonString")]
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
end: u32,
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue