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 d71da24136
commit 339231924b
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
8 changed files with 65 additions and 55 deletions

View file

@ -66,9 +66,9 @@ pub async fn collect_dates(concurrency: usize) {
// These are the sample playlists
let cases = [
(DateCase::Today, "PLMC9KNkIncKtPzgY-5rmhvj7fax8fdxoj"),
(DateCase::Yesterday, "PL3oW2tjiIxvQ98ZTLhBh5soCbE1mC3uAT"),
(DateCase::Ago, "PLeDakahyfrO9Amk2GFrzpI4UWOkgqzoIE"),
(DateCase::Today, "PL3oW2tjiIxvQ98ZTLhBh5soCbE1mC3uAT"),
(DateCase::Yesterday, "PLGBuKfnErZlCkRRgt06em8nbXvcV5Sae7"),
(DateCase::Ago, "PLAQ7nLSEnhWTEihjeM1I-ToPDJEKfZHZu"),
(DateCase::Jan, "PL1J-6JOckZtFjcni6Xj1pLYglJp6JCpKD"),
(DateCase::Feb, "PL1J-6JOckZtETrbzwZE7mRIIK6BzWNLAs"),
(DateCase::Mar, "PL1J-6JOckZtG3AVdvBXhMO64mB2k3BtKi"),

View file

@ -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()),

View file

@ -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,

View file

@ -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()),

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,
}
}
}

View file

@ -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 {

View file

@ -83,7 +83,9 @@
},
"date_order": "DY",
"months": {
"ጃን": 1,
"ጃንዩ": 1,
"ፌብ": 2,
"ፌብሩ": 2,
"ማርች": 3,
"ኤፕሪ": 4,
@ -2864,6 +2866,7 @@
"jan": 1,
"feb": 2,
"mar": 3,
"mars": 3,
"apr": 4,
"mai": 5,
"jun": 6,

View file

@ -20,8 +20,8 @@
"Today": "ዛሬ ተዘምኗል",
"Yesterday": "ትላንት ተዘምኗል",
"Ago": "ከ5 ቀናት በፊት ተዘምኗል",
"Jan": "ለመጨረሻ ጊዜ የዘመነው 3 ጃን 2020",
"Feb": "ለመጨረሻ ጊዜ የዘመነው 7 ፌብ 2016",
"Jan": "ለመጨረሻ ጊዜ የዘመነው 3 ጃን 2020",
"Feb": "ለመጨረሻ ጊዜ የዘመነው 7 ፌብ 2016",
"Mar": "ለመጨረሻ ጊዜ የዘመነው 9 ማርች 2015",
"Apr": "ለመጨረሻ ጊዜ የዘመነው 2 ኤፕሪ 2017",
"May": "ለመጨረሻ ጊዜ የዘመነው 22 ሜይ 2014",
@ -275,18 +275,18 @@
"Today": "Updated today",
"Yesterday": "Updated yesterday",
"Ago": "Updated 5 days ago",
"Jan": "Last updated on 03-Jan-2020",
"Feb": "Last updated on 07-Feb-2016",
"Mar": "Last updated on 09-Mar-2015",
"Apr": "Last updated on 02-Apr-2017",
"May": "Last updated on 22-May-2014",
"Jun": "Last updated on 28-Jun-2014",
"Jul": "Last updated on 02-Jul-2014",
"Aug": "Last updated on 23-Aug-2015",
"Sep": "Last updated on 16-Sept-2018",
"Oct": "Last updated on 31-Oct-2014",
"Nov": "Last updated on 03-Nov-2016",
"Dec": "Last updated on 24-Dec-2021"
"Jan": "Last updated on 3 Jan 2020",
"Feb": "Last updated on 7 Feb 2016",
"Mar": "Last updated on 9 Mar 2015",
"Apr": "Last updated on 2 Apr 2017",
"May": "Last updated on 22 May 2014",
"Jun": "Last updated on 28 Jun 2014",
"Jul": "Last updated on 2 Jul 2014",
"Aug": "Last updated on 23 Aug 2015",
"Sep": "Last updated on 16 Sept 2018",
"Oct": "Last updated on 31 Oct 2014",
"Nov": "Last updated on 3 Nov 2016",
"Dec": "Last updated on 24 Dec 2021"
},
"es": {
"Today": "Actualizada hoy",
@ -850,7 +850,7 @@
"Dec": "Сүүлд 2021оны 12-р сарын 24-нд шинэчилсэн"
},
"mr": {
"Today": "आज अपडेट केले",
"Today": "Updated today",
"Yesterday": "काल अपडेट केली",
"Ago": "5 दिवसांपूर्वी अपडेट केली",
"Jan": "3 जाने, 2020 रोजी अंतिम अपडेट",
@ -940,7 +940,7 @@
"Ago": "Oppdatert for 5 dager siden",
"Jan": "Sist oppdatert 3. jan. 2020",
"Feb": "Sist oppdatert 7. feb. 2016",
"Mar": "Sist oppdatert 9. mar. 2015",
"Mar": "Sist oppdatert 9. mars 2015",
"Apr": "Sist oppdatert 2. apr. 2017",
"May": "Sist oppdatert 22. mai 2014",
"Jun": "Sist oppdatert 28. juni 2014",