Compare commits

..

No commits in common. "2254b79cd61b116558d8036d91fcdd0f46905e12" and "305c3ee70e5ff2677b797f10b6f02caf6b49af80" have entirely different histories.

16 changed files with 31 additions and 13231 deletions

View file

@ -205,7 +205,6 @@ async fn channel_videos(testfiles: &Path) {
("shorts", "UCh8gHdtzO2tXd593_bjErWg"), // shorts and livestreams are rendered differently
("live", "UChs0pSaEoNLV4mevBFGaoKA"),
("empty", "UCxBa895m48H5idw5li7h-0g"),
("upcoming", "UCcvfHa-GHSOHFAjU0-Ie57A"),
] {
let mut json_path = testfiles.to_path_buf();
json_path.push("channel");

View file

@ -141,9 +141,6 @@ pub async fn generate_locales(project_root: &Path) {
let (languages, countries) = get_locales().await;
let code_head = r#"// This file is automatically generated. DO NOT EDIT.
//! Languages and countries
use std::{fmt::Display, str::FromStr};
use serde::{Deserialize, Serialize};
@ -180,41 +177,28 @@ impl FromStr for Country {
}
"#;
let mut code_langs = r#"/// Available languages
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
let mut code_langs =
r#"#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[serde(rename_all = "lowercase")]
pub enum Language {
"#
.to_owned();
"#.to_owned();
let mut code_countries = r#"/// Available countries
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
let mut code_countries =
r#"#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[serde(rename_all = "UPPERCASE")]
pub enum Country {
"#
.to_owned();
"#.to_owned();
let mut code_lang_array = format!(
"/// Array of all available languages\npub const LANGUAGES: [Language; {}] = [\n",
languages.len()
);
let mut code_country_array = format!(
"/// Array of all available countries\npub const COUNTRIES: [Country; {}] = [\n",
countries.len()
);
let mut code_lang_array = format!("pub const LANGUAGES: [Language; {}] = [\n", languages.len());
let mut code_country_array =
format!("pub const COUNTRIES: [Country; {}] = [\n", countries.len());
let mut code_lang_names = r#"impl Language {
/// Get the native name of the language
///
/// Examples: "English (US)", "Deutsch", "中文 (简体)"
pub fn name(&self) -> &str {
match self {
"#
.to_owned();
let mut code_country_names = r#"impl Country {
/// Get the English name of the country
///
/// Examples: "United States", "Germany"
pub fn name(&self) -> &str {
match self {
"#

View file

@ -1,5 +1,4 @@
use anyhow::{anyhow, bail, Result};
use chrono::TimeZone;
use serde::Serialize;
use url::Url;
@ -326,7 +325,6 @@ fn map_videos(
let is_live = toverlays.is_live();
let is_short = toverlays.is_short();
let to = toverlays.try_swap_remove(0);
Some(ChannelVideo {
id: video.video_id,
title: video.title,
@ -336,26 +334,15 @@ fn map_videos(
}),
thumbnail: video.thumbnail.into(),
publish_date: video
.upcoming_event_data
.published_time_text
.as_ref()
.map(|upc| {
chrono::Local.from_utc_datetime(&chrono::NaiveDateTime::from_timestamp(
upc.start_time,
0,
))
})
.or_else(|| {
video.published_time_text.as_ref().and_then(|txt| {
timeago::parse_timeago_or_warn(lang, txt, &mut warnings)
})
}),
.and_then(|txt| timeago::parse_timeago_or_warn(lang, txt, &mut warnings)),
publish_date_txt: video.published_time_text,
view_count: video
.view_count_text
.map(|txt| util::parse_numeric(&txt).unwrap_or_default()),
is_live,
is_short,
is_upcoming: video.upcoming_event_data.is_some(),
})
}
response::VideoListItem::ContinuationItemRenderer {
@ -645,7 +632,6 @@ mod tests {
#[case::shorts("shorts", "UCh8gHdtzO2tXd593_bjErWg")]
#[case::live("live", "UChs0pSaEoNLV4mevBFGaoKA")]
#[case::empty("empty", "UCxBa895m48H5idw5li7h-0g")]
#[case::upcoming("upcoming", "UCcvfHa-GHSOHFAjU0-Ie57A")]
fn t_map_channel_videos(#[case] name: &str, #[case] id: &str) {
let filename = format!("testfiles/channel/channel_videos_{}.json", name);
let json_path = Path::new(&filename);
@ -661,17 +647,10 @@ mod tests {
"deserialization/mapping warnings: {:?}",
map_res.warnings
);
if name == "upcoming" {
insta::assert_ron_snapshot!(format!("map_channel_videos_{}", name), map_res.c, {
".content.items[1:].publish_date" => "[date]",
});
} else {
insta::assert_ron_snapshot!(format!("map_channel_videos_{}", name), map_res.c, {
".content.items[].publish_date" => "[date]",
});
}
}
#[test]
fn t_map_channel_videos_cont() {

View file

@ -8,7 +8,6 @@ mod response;
mod video_details;
#[cfg(feature = "rss")]
#[cfg_attr(docsrs, doc(cfg(feature = "rss")))]
mod channel_rss;
use std::fmt::Debug;

View file

@ -731,6 +731,18 @@ mod tests {
assert!(player_data.expires_in_seconds > 10000);
}
#[tokio::test]
async fn tmp() {
let rp = RustyPipe::builder().strict().build();
let player_data = rp
.query()
.player("tVWWp1PqDus", ClientType::Desktop)
.await
.unwrap();
dbg!(&player_data);
}
#[test]
fn t_cipher_to_url() {
let signature_cipher = "s=w%3DAe%3DA6aDNQLkViKS7LOm9QtxZJHKwb53riq9qEFw-ecBWJCAiA%3DcEg0tn3dty9jEHszfzh4Ud__bg9CEHVx4ix-7dKsIPAhIQRw8JQ0qOA&sp=sig&url=https://rr5---sn-h0jelnez.googlevideo.com/videoplayback%3Fexpire%3D1659376413%26ei%3Dvb7nYvH5BMK8gAfBj7ToBQ%26ip%3D2003%253Ade%253Aaf06%253A6300%253Ac750%253A1b77%253Ac74a%253A80e3%26id%3Do-AB_BABwrXZJN428ZwDxq5ScPn2AbcGODnRlTVhCQ3mj2%26itag%3D251%26source%3Dyoutube%26requiressl%3Dyes%26mh%3DhH%26mm%3D31%252C26%26mn%3Dsn-h0jelnez%252Csn-4g5ednsl%26ms%3Dau%252Conr%26mv%3Dm%26mvi%3D5%26pl%3D37%26initcwndbps%3D1588750%26spc%3DlT-Khi831z8dTejFIRCvCEwx_6romtM%26vprv%3D1%26mime%3Daudio%252Fwebm%26ns%3Db_Mq_qlTFcSGlG9RpwpM9xQH%26gir%3Dyes%26clen%3D3781277%26dur%3D229.301%26lmt%3D1655510291473933%26mt%3D1659354538%26fvip%3D5%26keepalive%3Dyes%26fexp%3D24001373%252C24007246%26c%3DWEB%26rbqsm%3Dfr%26txp%3D4532434%26n%3Dd2g6G2hVqWIXxedQ%26sparams%3Dexpire%252Cei%252Cip%252Cid%252Citag%252Csource%252Crequiressl%252Cspc%252Cvprv%252Cmime%252Cns%252Cgir%252Cclen%252Cdur%252Clmt%26lsparams%3Dmh%252Cmm%252Cmn%252Cms%252Cmv%252Cmvi%252Cpl%252Cinitcwndbps%26lsig%3DAG3C_xAwRQIgCKCGJ1iu4wlaGXy3jcJyU3inh9dr1FIfqYOZEG_MdmACIQCbungkQYFk7EhD6K2YvLaHFMjKOFWjw001_tLb0lPDtg%253D%253D";

View file

@ -105,8 +105,6 @@ pub struct GridVideoRenderer {
/// Contains video length
#[serde_as(as = "VecSkipError<_>")]
pub thumbnail_overlays: Vec<TimeOverlay>,
/// Release date for upcoming videos
pub upcoming_event_data: Option<UpcomingEventData>,
}
/// Video displayed in recommendations
@ -168,15 +166,6 @@ pub struct GridPlaylistRenderer {
pub video_count_short_text: String,
}
#[serde_as]
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct UpcomingEventData {
/// Unixtime in seconds
#[serde_as(as = "JsonString")]
pub start_time: i64,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ContinuationItemRenderer {

View file

@ -175,7 +175,6 @@ Channel(
view_count: Some(19739),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "WHO8NBfpaO0",
@ -208,7 +207,6 @@ Channel(
view_count: Some(24194),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "W1Q8CxL95_Y",
@ -241,7 +239,6 @@ Channel(
view_count: Some(51443),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "lagxSrPeoYg",
@ -274,7 +271,6 @@ Channel(
view_count: Some(72324),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "qTctWW9_FmE",
@ -307,7 +303,6 @@ Channel(
view_count: Some(57348),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "3t9G80wk0pk",
@ -340,7 +335,6 @@ Channel(
view_count: Some(68645),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "7dze5CnZnmk",
@ -373,7 +367,6 @@ Channel(
view_count: Some(91388),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "6XnrZpPYgBg",
@ -406,7 +399,6 @@ Channel(
view_count: Some(39993),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "Psp3ltpFvws",
@ -439,7 +431,6 @@ Channel(
view_count: Some(22512),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "taVYTYz5vLE",
@ -472,7 +463,6 @@ Channel(
view_count: Some(40137),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "Y6cZrieFw-k",
@ -505,7 +495,6 @@ Channel(
view_count: Some(74510),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "Kr2XyhpUdUI",
@ -538,7 +527,6 @@ Channel(
view_count: Some(34487),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "rxGafdgkal8",
@ -571,7 +559,6 @@ Channel(
view_count: Some(44928),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "4yosozyeIP4",
@ -604,7 +591,6 @@ Channel(
view_count: Some(34324),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "06JtC2DC_dQ",
@ -637,7 +623,6 @@ Channel(
view_count: Some(63763),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "piquT76w9TI",
@ -670,7 +655,6 @@ Channel(
view_count: Some(149186),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "pKuUKT-zU-g",
@ -703,7 +687,6 @@ Channel(
view_count: Some(30130),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "_R4wQQNSO6k",
@ -736,7 +719,6 @@ Channel(
view_count: Some(48037),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "ikp5BorIo_M",
@ -769,7 +751,6 @@ Channel(
view_count: Some(81958),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "7O-QckjCXNo",
@ -802,7 +783,6 @@ Channel(
view_count: Some(42635),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "VutdTxF4E-0",
@ -835,7 +815,6 @@ Channel(
view_count: Some(25860),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "o7xfGuRaq94",
@ -868,7 +847,6 @@ Channel(
view_count: Some(63035),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "3WSIfHOv3fc",
@ -901,7 +879,6 @@ Channel(
view_count: Some(22731),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "8yXZJZCKImI",
@ -934,7 +911,6 @@ Channel(
view_count: Some(65765),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "vJ4pW6LKJWU",
@ -967,7 +943,6 @@ Channel(
view_count: Some(51555),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "myqiqUE00fo",
@ -1000,7 +975,6 @@ Channel(
view_count: Some(46638),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "xIokNnjuam8",
@ -1033,7 +1007,6 @@ Channel(
view_count: Some(62921),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "S3R4r2xvVYQ",
@ -1066,7 +1039,6 @@ Channel(
view_count: Some(66895),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "RlwcdUnRw6w",
@ -1099,7 +1071,6 @@ Channel(
view_count: Some(25894),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "R2fw2g6WFbg",
@ -1132,7 +1103,6 @@ Channel(
view_count: Some(80173),
is_live: false,
is_short: false,
is_upcoming: false,
),
],
ctoken: Some("4qmFsgKrARIYVUMyRGpGRTdYZjExVVJacVdCaWdjVk9RGmBFZ1oyYVdSbGIzTVlBeUFBTUFFNEFlb0RNRVZuYjBsMVMzWlpPVXREWWw5TVRraExSRWwzUVZSblpWRm5kMGx3ZFVOMGJWRlpVVjlOUjA1d2QwcEpRVlpCUVElM0QlM0SaAixicm93c2UtZmVlZFVDMkRqRkU3WGYxMVVSWnFXQmlnY1ZPUXZpZGVvczEwMg%3D%3D"),

View file

@ -36,7 +36,6 @@ Paginator(
view_count: Some(80296),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "JDXKrXJloSw",
@ -69,7 +68,6 @@ Paginator(
view_count: Some(36294),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "H8ot_YPi6QU",
@ -102,7 +100,6 @@ Paginator(
view_count: Some(34736),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "i1Ad5jfk_v4",
@ -135,7 +132,6 @@ Paginator(
view_count: Some(73544),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "GHbo4v8pahc",
@ -168,7 +164,6 @@ Paginator(
view_count: Some(67231),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "Uds-wLoaZmA",
@ -201,7 +196,6 @@ Paginator(
view_count: Some(44946),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "D9J-AmCcf4U",
@ -234,7 +228,6 @@ Paginator(
view_count: Some(43264),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "Eoh-JKVQZwg",
@ -267,7 +260,6 @@ Paginator(
view_count: Some(98175),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "U81glZBDpIg",
@ -300,7 +292,6 @@ Paginator(
view_count: Some(59376),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "gLfxznVJ2q0",
@ -333,7 +324,6 @@ Paginator(
view_count: Some(25496),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "GfihUkWPCQQ",
@ -366,7 +356,6 @@ Paginator(
view_count: Some(22982),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "yEG6pKUdIlg",
@ -399,7 +388,6 @@ Paginator(
view_count: Some(38804),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "wPzzPGzxD00",
@ -432,7 +420,6 @@ Paginator(
view_count: Some(25505),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "Tdge8vEODeY",
@ -465,7 +452,6 @@ Paginator(
view_count: Some(98432),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "ebQ2Im5zfT0",
@ -498,7 +484,6 @@ Paginator(
view_count: Some(53410),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "UrS5ezesA9s",
@ -531,7 +516,6 @@ Paginator(
view_count: Some(54771),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "c5M8P6oe9xY",
@ -564,7 +548,6 @@ Paginator(
view_count: Some(39823),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "9TDKP9RLlPs",
@ -597,7 +580,6 @@ Paginator(
view_count: Some(51596),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "hwggIw2HQuQ",
@ -630,7 +612,6 @@ Paginator(
view_count: Some(125391),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "xzSDJRC0F6c",
@ -663,7 +644,6 @@ Paginator(
view_count: Some(120457),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "9wuyPZjjR9k",
@ -696,7 +676,6 @@ Paginator(
view_count: Some(49062),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "vyJuMGEFbjQ",
@ -729,7 +708,6 @@ Paginator(
view_count: Some(49032),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "_pETMto-9iE",
@ -762,7 +740,6 @@ Paginator(
view_count: Some(64108),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "MvFf9RSJUhk",
@ -795,7 +772,6 @@ Paginator(
view_count: Some(76831),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "E6obq3T71vI",
@ -828,7 +804,6 @@ Paginator(
view_count: Some(49961),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "ZTwVQmUm6NY",
@ -861,7 +836,6 @@ Paginator(
view_count: Some(17393),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "prQinQ4MWmU",
@ -894,7 +868,6 @@ Paginator(
view_count: Some(38281),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "yMIzsFAztv4",
@ -927,7 +900,6 @@ Paginator(
view_count: Some(70004),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "QtqljdMwRyk",
@ -960,7 +932,6 @@ Paginator(
view_count: Some(93700),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "kcWwAweWjQg",
@ -993,7 +964,6 @@ Paginator(
view_count: Some(37515),
is_live: false,
is_short: false,
is_upcoming: false,
),
],
ctoken: Some("4qmFsgKxARIYVUMyRGpGRTdYZjExVVJacVdCaWdjVk9RGmZFZ1oyYVdSbGIzTVlBeUFBTUFFNEFlb0ROME5uVGtSU1JXdFRRM2RwU1cxMGNUaHpTVVJ6TkhCRlFrdEVTWGRCYW1jNFVXZHpTUzFRUkVodFVWbFJhVzloY0VWclowTlZSRWslM0SaAixicm93c2UtZmVlZFVDMkRqRkU3WGYxMVVSWnFXQmlnY1ZPUXZpZGVvczEwMg%3D%3D"),

View file

@ -159,7 +159,6 @@ Channel(
view_count: Some(94),
is_live: true,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "19hKXI1ENrY",
@ -192,7 +191,6 @@ Channel(
view_count: Some(381),
is_live: true,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "CqMUC5eXX7c",
@ -225,7 +223,6 @@ Channel(
view_count: Some(241528),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "A77SYlXKQEM",
@ -258,7 +255,6 @@ Channel(
view_count: Some(118351),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "72vkRHQfjbk",
@ -291,7 +287,6 @@ Channel(
view_count: Some(157971),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "AMWMDhibROw",
@ -324,7 +319,6 @@ Channel(
view_count: Some(82309),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "9UMxZofMNbA",
@ -357,7 +351,6 @@ Channel(
view_count: Some(2043),
is_live: true,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "a2sEYVwBvX4",
@ -390,7 +383,6 @@ Channel(
view_count: Some(186475),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "JAY-prtJnGY",
@ -423,7 +415,6 @@ Channel(
view_count: Some(66425),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "DySa8OrQDi4",
@ -456,7 +447,6 @@ Channel(
view_count: Some(1520020),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "NqzXULaB8MA",
@ -489,7 +479,6 @@ Channel(
view_count: Some(37549),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "UGzy6uhZkmw",
@ -522,7 +511,6 @@ Channel(
view_count: Some(33002),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "iuvapHKpW8A",
@ -555,7 +543,6 @@ Channel(
view_count: Some(42036),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "n_1Nwht-Gh4",
@ -588,7 +575,6 @@ Channel(
view_count: Some(322935),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "6TptI5BtP5U",
@ -621,7 +607,6 @@ Channel(
view_count: Some(91980),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "36YnV9STBqc",
@ -654,7 +639,6 @@ Channel(
view_count: Some(4030),
is_live: true,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "7x6ii2TcsPE",
@ -687,7 +671,6 @@ Channel(
view_count: Some(288098),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "mxV5MBZYYDE",
@ -720,7 +703,6 @@ Channel(
view_count: Some(50818),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "hh2AOoPoAIo",
@ -753,7 +735,6 @@ Channel(
view_count: Some(98431),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "aFlvhtWsJ0g",
@ -786,7 +767,6 @@ Channel(
view_count: Some(572456),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "cD-d7u6fnEI",
@ -819,7 +799,6 @@ Channel(
view_count: Some(3114909),
is_live: false,
is_short: false,
is_upcoming: false,
),
],
ctoken: None,

View file

@ -131,7 +131,6 @@ Channel(
view_count: Some(443549),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "SRrvxFc2b2c",
@ -149,7 +148,6 @@ Channel(
view_count: Some(1154962),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "l9TiwunjzgA",
@ -182,7 +180,6 @@ Channel(
view_count: Some(477460),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "cNx0ql9gnf4",
@ -200,7 +197,6 @@ Channel(
view_count: Some(1388173),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "fGQUWI4o__A",
@ -218,7 +214,6 @@ Channel(
view_count: Some(1738301),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "Q73VTjdqVA8",
@ -236,7 +231,6 @@ Channel(
view_count: Some(1316594),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "pRVSdUxdsVw",
@ -269,7 +263,6 @@ Channel(
view_count: Some(478703),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "gTG2WDbiYGo",
@ -287,7 +280,6 @@ Channel(
view_count: Some(1412213),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "y5JK5YFp92g",
@ -305,7 +297,6 @@ Channel(
view_count: Some(1513305),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "pvSWHm4wlxY",
@ -323,7 +314,6 @@ Channel(
view_count: Some(8936223),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "2FJVhdOO0F0",
@ -356,7 +346,6 @@ Channel(
view_count: Some(987083),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "CqFGACRrWJE",
@ -374,7 +363,6 @@ Channel(
view_count: Some(2769717),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "CutR_1SDDzY",
@ -407,7 +395,6 @@ Channel(
view_count: Some(497660),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "DdGr6t2NqKc",
@ -425,7 +412,6 @@ Channel(
view_count: Some(572107),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "jKS44NMWuXw",
@ -443,7 +429,6 @@ Channel(
view_count: Some(1707132),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "kx1YtJM_vbI",
@ -461,7 +446,6 @@ Channel(
view_count: Some(933094),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "Sdbzs-1WWH0",
@ -479,7 +463,6 @@ Channel(
view_count: Some(5985184),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "9qBHyJIDous",
@ -497,7 +480,6 @@ Channel(
view_count: Some(14741387),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "mBeFDb4gp8s",
@ -515,7 +497,6 @@ Channel(
view_count: Some(2511322),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "b38r1UYqoBQ",
@ -533,7 +514,6 @@ Channel(
view_count: Some(2364408),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "KUz7oArksR4",
@ -566,7 +546,6 @@ Channel(
view_count: Some(706059),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "RdFk4WaifEo",
@ -584,7 +563,6 @@ Channel(
view_count: Some(1947627),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "GuyGyzZcumI",
@ -602,7 +580,6 @@ Channel(
view_count: Some(4763839),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "07Zipsb3-qU",
@ -620,7 +597,6 @@ Channel(
view_count: Some(1915695),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "3kaePnU6Clo",
@ -638,7 +614,6 @@ Channel(
view_count: Some(7268944),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "rt4rXMftnpg",
@ -656,7 +631,6 @@ Channel(
view_count: Some(2539103),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "DTyLUvbf128",
@ -674,7 +648,6 @@ Channel(
view_count: Some(5545680),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "DzjLBgIe_aI",
@ -692,7 +665,6 @@ Channel(
view_count: Some(2202314),
is_live: false,
is_short: true,
is_upcoming: false,
),
ChannelVideo(
id: "sPb2gyN-hnE",
@ -725,7 +697,6 @@ Channel(
view_count: Some(613416),
is_live: false,
is_short: false,
is_upcoming: false,
),
ChannelVideo(
id: "9JboRKeJ2m4",
@ -743,7 +714,6 @@ Channel(
view_count: Some(6443699),
is_live: false,
is_short: true,
is_upcoming: false,
),
],
ctoken: Some("4qmFsgKrARIYVUNoOGdIZHR6TzJ0WGQ1OTNfYmpFcldnGmBFZ1oyYVdSbGIzTVlBeUFBTUFFNEFlb0RNRVZuYzBrM2NsTnVkazF4U1hWemRqQkJVMmQ1VFVGRk5FaHJTVXhEVUhac2NscHJSMFZKWVhWd016RkpRVlpCUVElM0QlM0SaAixicm93c2UtZmVlZFVDaDhnSGR0ek8ydFhkNTkzX2JqRXJXZ3ZpZGVvczEwMg%3D%3D"),

View file

@ -1,12 +1,8 @@
// This file is automatically generated. DO NOT EDIT.
//! Languages and countries
use std::{fmt::Display, str::FromStr};
use serde::{Deserialize, Serialize};
/// Available languages
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[serde(rename_all = "lowercase")]
pub enum Language {
@ -188,7 +184,6 @@ pub enum Language {
Zu,
}
/// Available countries
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[serde(rename_all = "UPPERCASE")]
pub enum Country {
@ -412,7 +407,6 @@ pub enum Country {
Zw,
}
/// Array of all available languages
pub const LANGUAGES: [Language; 83] = [
Language::Af,
Language::Am,
@ -499,7 +493,6 @@ pub const LANGUAGES: [Language; 83] = [
Language::Zu,
];
/// Array of all available countries
pub const COUNTRIES: [Country; 109] = [
Country::Ae,
Country::Ar,
@ -613,9 +606,6 @@ pub const COUNTRIES: [Country; 109] = [
];
impl Language {
/// Get the native name of the language
///
/// Examples: "English (US)", "Deutsch", "中文 (简体)"
pub fn name(&self) -> &str {
match self {
Language::Af => "Afrikaans",
@ -706,9 +696,6 @@ impl Language {
}
impl Country {
/// Get the English name of the country
///
/// Examples: "United States", "Germany"
pub fn name(&self) -> &str {
match self {
Country::Ae => "United Arab Emirates",

View file

@ -465,9 +465,9 @@ pub struct VideoDetails {
///
/// Information about the license:
///
/// <https://www.youtube.com/t/creative_commons>
/// https://www.youtube.com/t/creative_commons
///
/// <https://creativecommons.org/licenses/by/3.0/>
/// https://creativecommons.org/licenses/by/3.0/
pub is_ccommons: bool,
/// Chapters of the video
pub chapters: Vec<Chapter>,
@ -670,13 +670,12 @@ pub struct ChannelVideo {
/// Video publishing date.
///
/// `None` if the date could not be parsed.
/// May be in the future for upcoming videos
pub publish_date: Option<DateTime<Local>>,
/// Textual video publish date (e.g. `11 months ago`, depends on language)
///
/// Is `None` for livestreams and upcoming videos.
/// Is `None` for livestreams.
pub publish_date_txt: Option<String>,
/// Number of views / current viewers in case of a livestream.
/// View count
///
/// `None` if it could not be extracted.
pub view_count: Option<u64>,
@ -684,8 +683,6 @@ pub struct ChannelVideo {
pub is_live: bool,
/// Is the video a YouTube Short video (vertical and <60s)?
pub is_short: bool,
/// Is the video announced, but not released yet (YouTube Premiere)?
pub is_upcoming: bool,
}
/// Playlist fetched from a YouTube channel
@ -744,7 +741,7 @@ pub struct ChannelRssVideo {
pub publish_date: DateTime<Utc>,
/// Date and time when the RSS feed entry was last updated.
pub update_date: DateTime<Utc>,
/// Number of views / current viewers in case of a livestream.
/// View count
pub view_count: u64,
/// Number of likes
///

View file

@ -1,5 +1,3 @@
//! Data model for texts with links
use serde::{Deserialize, Serialize};
#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
@ -43,7 +41,6 @@ pub trait ToPlaintext {
/// Trait for converting rich text to html.
#[cfg(feature = "html")]
#[cfg_attr(docsrs, doc(cfg(feature = "html")))]
pub trait ToHtml {
/// Convert rich text to html.
fn to_html(&self) -> String {
@ -96,7 +93,6 @@ impl ToPlaintext for TextComponent {
}
#[cfg(feature = "html")]
#[cfg_attr(docsrs, doc(cfg(feature = "html")))]
impl ToHtml for TextComponent {
fn to_html_yt_host(&self, yt_host: &str) -> String {
match self {
@ -131,7 +127,6 @@ impl ToPlaintext for RichText {
}
#[cfg(feature = "html")]
#[cfg_attr(docsrs, doc(cfg(feature = "html")))]
impl ToHtml for RichText {
fn to_html_yt_host(&self, yt_host: &str) -> String {
self.0.iter().map(|c| c.to_html_yt_host(yt_host)).collect()

View file

@ -1,5 +1,3 @@
//! Filters for selecting audio/video streams
use std::collections::HashSet;
use super::{

File diff suppressed because it is too large Load diff