fix: update dictionary, fix parsing playlist dates in am and no

This commit is contained in:
ThetaDev 2024-02-13 18:38:58 +01:00
parent ebac82421b
commit 582a386d76
8 changed files with 65 additions and 55 deletions

View file

@ -27,7 +27,7 @@ use serde::{Deserialize, Serialize};
use time::{macros::format_description, OffsetDateTime};
use tracing::error;
use crate::{deobfuscate::DeobfData, util};
use crate::{deobfuscate::DeobfData, param::Language, util};
pub(crate) const DEFAULT_REPORT_DIR: &str = "rustypipe_reports";
@ -67,6 +67,9 @@ pub struct RustyPipeInfo<'a> {
/// Date/Time when the event occurred
#[serde(with = "time::serde::rfc3339")]
pub date: OffsetDateTime,
/// YouTube content language
#[serde(skip_serializing_if = "Option::is_none")]
pub language: Option<Language>,
}
/// Reported HTTP request data
@ -101,12 +104,13 @@ pub enum Level {
ERR,
}
impl Default for RustyPipeInfo<'_> {
fn default() -> Self {
impl RustyPipeInfo<'_> {
pub(crate) fn new(language: Option<Language>) -> Self {
Self {
package: env!("CARGO_PKG_NAME"),
version: env!("CARGO_PKG_VERSION"),
date: util::now_sec(),
language,
}
}
}