fix: update dictionary, fix parsing playlist dates in am and no
This commit is contained in:
parent
d71da24136
commit
339231924b
8 changed files with 65 additions and 55 deletions
|
|
@ -45,7 +45,7 @@ impl RustyPipeQuery {
|
|||
Err(e) => {
|
||||
if let Some(reporter) = &self.client.inner.reporter {
|
||||
let report = Report {
|
||||
info: RustyPipeInfo::default(),
|
||||
info: RustyPipeInfo::new(Some(self.opts.lang)),
|
||||
level: crate::report::Level::ERR,
|
||||
operation: "channel_rss",
|
||||
error: Some(e.to_string()),
|
||||
|
|
|
|||
|
|
@ -1428,7 +1428,7 @@ impl RustyPipeQuery {
|
|||
if level > Level::DBG || self.opts.report {
|
||||
if let Some(reporter) = &self.client.inner.reporter {
|
||||
let report = Report {
|
||||
info: RustyPipeInfo::default(),
|
||||
info: RustyPipeInfo::new(Some(self.opts.lang)),
|
||||
level,
|
||||
operation: &format!("{operation}({id})"),
|
||||
error,
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ impl DeobfData {
|
|||
if let Err(e) = &res {
|
||||
if let Some(reporter) = reporter {
|
||||
let report = Report {
|
||||
info: RustyPipeInfo::default(),
|
||||
info: RustyPipeInfo::new(None),
|
||||
level: Level::ERR,
|
||||
operation: "extract_deobf",
|
||||
error: Some(e.to_string()),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,25 +185,27 @@ pub(crate) fn entry(lang: Language) -> Entry {
|
|||
},
|
||||
date_order: &[DateCmp::D, DateCmp::Y],
|
||||
months: ::phf::Map {
|
||||
key: 15467950696543387533,
|
||||
key: 7485420634051515786,
|
||||
disps: &[
|
||||
(0, 0),
|
||||
(1, 1),
|
||||
(6, 8),
|
||||
(2, 0),
|
||||
(0, 10),
|
||||
(9, 7),
|
||||
],
|
||||
entries: &[
|
||||
("ፌብሩ", 2),
|
||||
("ጁን", 6),
|
||||
("ኦገስ", 8),
|
||||
("ኤፕሪ", 4),
|
||||
("ዲሴም", 12),
|
||||
("ጁላይ", 7),
|
||||
("ማርች", 3),
|
||||
("ሴፕቴ", 9),
|
||||
("ኖቬም", 11),
|
||||
("ጃንዩ", 1),
|
||||
("ኦክቶ", 10),
|
||||
("ሜይ", 5),
|
||||
("ሴፕቴ", 9),
|
||||
("ዲሴም", 12),
|
||||
("ፌብ", 2),
|
||||
("ፌብሩ", 2),
|
||||
("ኦገስ", 8),
|
||||
("ማርች", 3),
|
||||
("ኤፕሪ", 4),
|
||||
("ኦክቶ", 10),
|
||||
("ጃንዩ", 1),
|
||||
("ኖቬም", 11),
|
||||
("ጁን", 6),
|
||||
("ጃን", 1),
|
||||
("ጁላይ", 7),
|
||||
],
|
||||
},
|
||||
timeago_nd_tokens: ::phf::Map {
|
||||
|
|
@ -4876,27 +4878,28 @@ pub(crate) fn entry(lang: Language) -> Entry {
|
|||
},
|
||||
date_order: &[DateCmp::D, DateCmp::Y],
|
||||
months: ::phf::Map {
|
||||
key: 10121458955350035957,
|
||||
key: 1937371814602216758,
|
||||
disps: &[
|
||||
(5, 10),
|
||||
(2, 1),
|
||||
(0, 0),
|
||||
(14, 0),
|
||||
(10, 3),
|
||||
(1, 8),
|
||||
],
|
||||
entries: &[
|
||||
("feb", 2),
|
||||
("jan", 1),
|
||||
("sep", 9),
|
||||
("jul", 7),
|
||||
("juli", 7),
|
||||
("jun", 6),
|
||||
("juni", 6),
|
||||
("mar", 3),
|
||||
("okt", 10),
|
||||
("nov", 11),
|
||||
("aug", 8),
|
||||
("des", 12),
|
||||
("mai", 5),
|
||||
("apr", 4),
|
||||
("jul", 7),
|
||||
("des", 12),
|
||||
("juli", 7),
|
||||
("okt", 10),
|
||||
("mars", 3),
|
||||
("juni", 6),
|
||||
("jun", 6),
|
||||
("feb", 2),
|
||||
("aug", 8),
|
||||
("nov", 11),
|
||||
("sep", 9),
|
||||
("mai", 5),
|
||||
],
|
||||
},
|
||||
timeago_nd_tokens: ::phf::Map {
|
||||
|
|
|
|||
Reference in a new issue