fix: update dictionary, fix parsing playlist dates in am and no
This commit is contained in:
parent
ebac82421b
commit
582a386d76
8 changed files with 65 additions and 55 deletions
|
|
@ -66,9 +66,9 @@ pub async fn collect_dates(concurrency: usize) {
|
||||||
|
|
||||||
// These are the sample playlists
|
// These are the sample playlists
|
||||||
let cases = [
|
let cases = [
|
||||||
(DateCase::Today, "PLMC9KNkIncKtPzgY-5rmhvj7fax8fdxoj"),
|
(DateCase::Today, "PL3oW2tjiIxvQ98ZTLhBh5soCbE1mC3uAT"),
|
||||||
(DateCase::Yesterday, "PL3oW2tjiIxvQ98ZTLhBh5soCbE1mC3uAT"),
|
(DateCase::Yesterday, "PLGBuKfnErZlCkRRgt06em8nbXvcV5Sae7"),
|
||||||
(DateCase::Ago, "PLeDakahyfrO9Amk2GFrzpI4UWOkgqzoIE"),
|
(DateCase::Ago, "PLAQ7nLSEnhWTEihjeM1I-ToPDJEKfZHZu"),
|
||||||
(DateCase::Jan, "PL1J-6JOckZtFjcni6Xj1pLYglJp6JCpKD"),
|
(DateCase::Jan, "PL1J-6JOckZtFjcni6Xj1pLYglJp6JCpKD"),
|
||||||
(DateCase::Feb, "PL1J-6JOckZtETrbzwZE7mRIIK6BzWNLAs"),
|
(DateCase::Feb, "PL1J-6JOckZtETrbzwZE7mRIIK6BzWNLAs"),
|
||||||
(DateCase::Mar, "PL1J-6JOckZtG3AVdvBXhMO64mB2k3BtKi"),
|
(DateCase::Mar, "PL1J-6JOckZtG3AVdvBXhMO64mB2k3BtKi"),
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ impl RustyPipeQuery {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
if let Some(reporter) = &self.client.inner.reporter {
|
if let Some(reporter) = &self.client.inner.reporter {
|
||||||
let report = Report {
|
let report = Report {
|
||||||
info: RustyPipeInfo::default(),
|
info: RustyPipeInfo::new(Some(self.opts.lang)),
|
||||||
level: crate::report::Level::ERR,
|
level: crate::report::Level::ERR,
|
||||||
operation: "channel_rss",
|
operation: "channel_rss",
|
||||||
error: Some(e.to_string()),
|
error: Some(e.to_string()),
|
||||||
|
|
|
||||||
|
|
@ -1428,7 +1428,7 @@ impl RustyPipeQuery {
|
||||||
if level > Level::DBG || self.opts.report {
|
if level > Level::DBG || self.opts.report {
|
||||||
if let Some(reporter) = &self.client.inner.reporter {
|
if let Some(reporter) = &self.client.inner.reporter {
|
||||||
let report = Report {
|
let report = Report {
|
||||||
info: RustyPipeInfo::default(),
|
info: RustyPipeInfo::new(Some(self.opts.lang)),
|
||||||
level,
|
level,
|
||||||
operation: &format!("{operation}({id})"),
|
operation: &format!("{operation}({id})"),
|
||||||
error,
|
error,
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ impl DeobfData {
|
||||||
if let Err(e) = &res {
|
if let Err(e) = &res {
|
||||||
if let Some(reporter) = reporter {
|
if let Some(reporter) = reporter {
|
||||||
let report = Report {
|
let report = Report {
|
||||||
info: RustyPipeInfo::default(),
|
info: RustyPipeInfo::new(None),
|
||||||
level: Level::ERR,
|
level: Level::ERR,
|
||||||
operation: "extract_deobf",
|
operation: "extract_deobf",
|
||||||
error: Some(e.to_string()),
|
error: Some(e.to_string()),
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use serde::{Deserialize, Serialize};
|
||||||
use time::{macros::format_description, OffsetDateTime};
|
use time::{macros::format_description, OffsetDateTime};
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
use crate::{deobfuscate::DeobfData, util};
|
use crate::{deobfuscate::DeobfData, param::Language, util};
|
||||||
|
|
||||||
pub(crate) const DEFAULT_REPORT_DIR: &str = "rustypipe_reports";
|
pub(crate) const DEFAULT_REPORT_DIR: &str = "rustypipe_reports";
|
||||||
|
|
||||||
|
|
@ -67,6 +67,9 @@ pub struct RustyPipeInfo<'a> {
|
||||||
/// Date/Time when the event occurred
|
/// Date/Time when the event occurred
|
||||||
#[serde(with = "time::serde::rfc3339")]
|
#[serde(with = "time::serde::rfc3339")]
|
||||||
pub date: OffsetDateTime,
|
pub date: OffsetDateTime,
|
||||||
|
/// YouTube content language
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub language: Option<Language>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reported HTTP request data
|
/// Reported HTTP request data
|
||||||
|
|
@ -101,12 +104,13 @@ pub enum Level {
|
||||||
ERR,
|
ERR,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for RustyPipeInfo<'_> {
|
impl RustyPipeInfo<'_> {
|
||||||
fn default() -> Self {
|
pub(crate) fn new(language: Option<Language>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
package: env!("CARGO_PKG_NAME"),
|
package: env!("CARGO_PKG_NAME"),
|
||||||
version: env!("CARGO_PKG_VERSION"),
|
version: env!("CARGO_PKG_VERSION"),
|
||||||
date: util::now_sec(),
|
date: util::now_sec(),
|
||||||
|
language,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,25 +185,27 @@ pub(crate) fn entry(lang: Language) -> Entry {
|
||||||
},
|
},
|
||||||
date_order: &[DateCmp::D, DateCmp::Y],
|
date_order: &[DateCmp::D, DateCmp::Y],
|
||||||
months: ::phf::Map {
|
months: ::phf::Map {
|
||||||
key: 15467950696543387533,
|
key: 7485420634051515786,
|
||||||
disps: &[
|
disps: &[
|
||||||
(0, 0),
|
(2, 0),
|
||||||
(1, 1),
|
(0, 10),
|
||||||
(6, 8),
|
(9, 7),
|
||||||
],
|
],
|
||||||
entries: &[
|
entries: &[
|
||||||
("ፌብሩ", 2),
|
|
||||||
("ጁን", 6),
|
|
||||||
("ኦገስ", 8),
|
|
||||||
("ኤፕሪ", 4),
|
|
||||||
("ዲሴም", 12),
|
|
||||||
("ጁላይ", 7),
|
|
||||||
("ማርች", 3),
|
|
||||||
("ሴፕቴ", 9),
|
|
||||||
("ኖቬም", 11),
|
|
||||||
("ጃንዩ", 1),
|
|
||||||
("ኦክቶ", 10),
|
|
||||||
("ሜይ", 5),
|
("ሜይ", 5),
|
||||||
|
("ሴፕቴ", 9),
|
||||||
|
("ዲሴም", 12),
|
||||||
|
("ፌብ", 2),
|
||||||
|
("ፌብሩ", 2),
|
||||||
|
("ኦገስ", 8),
|
||||||
|
("ማርች", 3),
|
||||||
|
("ኤፕሪ", 4),
|
||||||
|
("ኦክቶ", 10),
|
||||||
|
("ጃንዩ", 1),
|
||||||
|
("ኖቬም", 11),
|
||||||
|
("ጁን", 6),
|
||||||
|
("ጃን", 1),
|
||||||
|
("ጁላይ", 7),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
timeago_nd_tokens: ::phf::Map {
|
timeago_nd_tokens: ::phf::Map {
|
||||||
|
|
@ -4876,27 +4878,28 @@ pub(crate) fn entry(lang: Language) -> Entry {
|
||||||
},
|
},
|
||||||
date_order: &[DateCmp::D, DateCmp::Y],
|
date_order: &[DateCmp::D, DateCmp::Y],
|
||||||
months: ::phf::Map {
|
months: ::phf::Map {
|
||||||
key: 10121458955350035957,
|
key: 1937371814602216758,
|
||||||
disps: &[
|
disps: &[
|
||||||
(5, 10),
|
(14, 0),
|
||||||
(2, 1),
|
(10, 3),
|
||||||
(0, 0),
|
(1, 8),
|
||||||
],
|
],
|
||||||
entries: &[
|
entries: &[
|
||||||
("feb", 2),
|
|
||||||
("jan", 1),
|
("jan", 1),
|
||||||
("sep", 9),
|
|
||||||
("jul", 7),
|
|
||||||
("juli", 7),
|
|
||||||
("jun", 6),
|
|
||||||
("juni", 6),
|
|
||||||
("mar", 3),
|
("mar", 3),
|
||||||
("okt", 10),
|
|
||||||
("nov", 11),
|
|
||||||
("aug", 8),
|
|
||||||
("des", 12),
|
|
||||||
("mai", 5),
|
|
||||||
("apr", 4),
|
("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 {
|
timeago_nd_tokens: ::phf::Map {
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,9 @@
|
||||||
},
|
},
|
||||||
"date_order": "DY",
|
"date_order": "DY",
|
||||||
"months": {
|
"months": {
|
||||||
|
"ጃን": 1,
|
||||||
"ጃንዩ": 1,
|
"ጃንዩ": 1,
|
||||||
|
"ፌብ": 2,
|
||||||
"ፌብሩ": 2,
|
"ፌብሩ": 2,
|
||||||
"ማርች": 3,
|
"ማርች": 3,
|
||||||
"ኤፕሪ": 4,
|
"ኤፕሪ": 4,
|
||||||
|
|
@ -2864,6 +2866,7 @@
|
||||||
"jan": 1,
|
"jan": 1,
|
||||||
"feb": 2,
|
"feb": 2,
|
||||||
"mar": 3,
|
"mar": 3,
|
||||||
|
"mars": 3,
|
||||||
"apr": 4,
|
"apr": 4,
|
||||||
"mai": 5,
|
"mai": 5,
|
||||||
"jun": 6,
|
"jun": 6,
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@
|
||||||
"Today": "ዛሬ ተዘምኗል",
|
"Today": "ዛሬ ተዘምኗል",
|
||||||
"Yesterday": "ትላንት ተዘምኗል",
|
"Yesterday": "ትላንት ተዘምኗል",
|
||||||
"Ago": "ከ5 ቀናት በፊት ተዘምኗል",
|
"Ago": "ከ5 ቀናት በፊት ተዘምኗል",
|
||||||
"Jan": "ለመጨረሻ ጊዜ የዘመነው 3 ጃንዩ 2020",
|
"Jan": "ለመጨረሻ ጊዜ የዘመነው 3 ጃን 2020",
|
||||||
"Feb": "ለመጨረሻ ጊዜ የዘመነው 7 ፌብሩ 2016",
|
"Feb": "ለመጨረሻ ጊዜ የዘመነው 7 ፌብ 2016",
|
||||||
"Mar": "ለመጨረሻ ጊዜ የዘመነው 9 ማርች 2015",
|
"Mar": "ለመጨረሻ ጊዜ የዘመነው 9 ማርች 2015",
|
||||||
"Apr": "ለመጨረሻ ጊዜ የዘመነው 2 ኤፕሪ 2017",
|
"Apr": "ለመጨረሻ ጊዜ የዘመነው 2 ኤፕሪ 2017",
|
||||||
"May": "ለመጨረሻ ጊዜ የዘመነው 22 ሜይ 2014",
|
"May": "ለመጨረሻ ጊዜ የዘመነው 22 ሜይ 2014",
|
||||||
|
|
@ -275,18 +275,18 @@
|
||||||
"Today": "Updated today",
|
"Today": "Updated today",
|
||||||
"Yesterday": "Updated yesterday",
|
"Yesterday": "Updated yesterday",
|
||||||
"Ago": "Updated 5 days ago",
|
"Ago": "Updated 5 days ago",
|
||||||
"Jan": "Last updated on 03-Jan-2020",
|
"Jan": "Last updated on 3 Jan 2020",
|
||||||
"Feb": "Last updated on 07-Feb-2016",
|
"Feb": "Last updated on 7 Feb 2016",
|
||||||
"Mar": "Last updated on 09-Mar-2015",
|
"Mar": "Last updated on 9 Mar 2015",
|
||||||
"Apr": "Last updated on 02-Apr-2017",
|
"Apr": "Last updated on 2 Apr 2017",
|
||||||
"May": "Last updated on 22-May-2014",
|
"May": "Last updated on 22 May 2014",
|
||||||
"Jun": "Last updated on 28-Jun-2014",
|
"Jun": "Last updated on 28 Jun 2014",
|
||||||
"Jul": "Last updated on 02-Jul-2014",
|
"Jul": "Last updated on 2 Jul 2014",
|
||||||
"Aug": "Last updated on 23-Aug-2015",
|
"Aug": "Last updated on 23 Aug 2015",
|
||||||
"Sep": "Last updated on 16-Sept-2018",
|
"Sep": "Last updated on 16 Sept 2018",
|
||||||
"Oct": "Last updated on 31-Oct-2014",
|
"Oct": "Last updated on 31 Oct 2014",
|
||||||
"Nov": "Last updated on 03-Nov-2016",
|
"Nov": "Last updated on 3 Nov 2016",
|
||||||
"Dec": "Last updated on 24-Dec-2021"
|
"Dec": "Last updated on 24 Dec 2021"
|
||||||
},
|
},
|
||||||
"es": {
|
"es": {
|
||||||
"Today": "Actualizada hoy",
|
"Today": "Actualizada hoy",
|
||||||
|
|
@ -850,7 +850,7 @@
|
||||||
"Dec": "Сүүлд 2021 оны 12-р сарын 24-нд шинэчилсэн"
|
"Dec": "Сүүлд 2021 оны 12-р сарын 24-нд шинэчилсэн"
|
||||||
},
|
},
|
||||||
"mr": {
|
"mr": {
|
||||||
"Today": "आज अपडेट केले",
|
"Today": "Updated today",
|
||||||
"Yesterday": "काल अपडेट केली",
|
"Yesterday": "काल अपडेट केली",
|
||||||
"Ago": "5 दिवसांपूर्वी अपडेट केली",
|
"Ago": "5 दिवसांपूर्वी अपडेट केली",
|
||||||
"Jan": "3 जाने, 2020 रोजी अंतिम अपडेट",
|
"Jan": "3 जाने, 2020 रोजी अंतिम अपडेट",
|
||||||
|
|
@ -940,7 +940,7 @@
|
||||||
"Ago": "Oppdatert for 5 dager siden",
|
"Ago": "Oppdatert for 5 dager siden",
|
||||||
"Jan": "Sist oppdatert 3. jan. 2020",
|
"Jan": "Sist oppdatert 3. jan. 2020",
|
||||||
"Feb": "Sist oppdatert 7. feb. 2016",
|
"Feb": "Sist oppdatert 7. feb. 2016",
|
||||||
"Mar": "Sist oppdatert 9. mar. 2015",
|
"Mar": "Sist oppdatert 9. mars 2015",
|
||||||
"Apr": "Sist oppdatert 2. apr. 2017",
|
"Apr": "Sist oppdatert 2. apr. 2017",
|
||||||
"May": "Sist oppdatert 22. mai 2014",
|
"May": "Sist oppdatert 22. mai 2014",
|
||||||
"Jun": "Sist oppdatert 28. juni 2014",
|
"Jun": "Sist oppdatert 28. juni 2014",
|
||||||
|
|
|
||||||
Reference in a new issue