feat: add Zz (global) country param

This commit is contained in:
ThetaDev 2022-12-01 13:31:36 +01:00
parent f20ea693a6
commit 88104753e0
11 changed files with 8678 additions and 53700 deletions

View file

@ -7,7 +7,10 @@ use std::{
use rustypipe::{
client::{ClientType, RustyPipe},
param::search_filter::{self, Entity, SearchFilter},
param::{
search_filter::{self, Entity, SearchFilter},
Country,
},
report::{Report, Reporter},
};
@ -830,11 +833,7 @@ async fn music_new_videos(testfiles: &Path) {
}
async fn music_charts(testfiles: &Path) {
for (name, id) in [
("default", None),
("US", Some("US")),
("unavailable", Some("MY")),
] {
for (name, country) in [("global", Some(Country::Zz)), ("US", Some(Country::Us))] {
let mut json_path = testfiles.to_path_buf();
json_path.push("music_charts");
json_path.push(&format!("charts_{}.json", name));
@ -843,6 +842,6 @@ async fn music_charts(testfiles: &Path) {
}
let rp = rp_testfile(&json_path);
rp.query().music_charts(id).await.unwrap();
rp.query().music_charts(country).await.unwrap();
}
}

View file

@ -235,22 +235,23 @@ pub enum Country {
.collect::<String>();
// Language enum
let _ = write!(code_langs, " /// {}\n ", n);
write!(code_langs, " /// {}\n ", n).unwrap();
if c.contains('-') {
let _ = write!(code_langs, "#[serde(rename = \"{}\")]\n ", c);
write!(code_langs, "#[serde(rename = \"{}\")]\n ", c).unwrap();
}
code_langs += &enum_name;
code_langs += ",\n";
// Language array
let _ = writeln!(code_lang_array, " Language::{},", enum_name);
writeln!(code_lang_array, " Language::{},", enum_name).unwrap();
// Language names
let _ = writeln!(
writeln!(
code_lang_names,
" Language::{} => \"{}\",",
enum_name, n
);
)
.unwrap();
});
code_langs += "}\n";
@ -258,19 +259,26 @@ pub enum Country {
let enum_name = c[0..1].to_owned().to_uppercase() + &c[1..].to_owned().to_lowercase();
// Country enum
let _ = writeln!(code_countries, " /// {}", n);
let _ = writeln!(code_countries, " {},", enum_name);
writeln!(code_countries, " /// {}", n).unwrap();
writeln!(code_countries, " {},", enum_name).unwrap();
// Country array
let _ = writeln!(code_country_array, " Country::{},", enum_name);
writeln!(code_country_array, " Country::{},", enum_name).unwrap();
// Country names
let _ = writeln!(
writeln!(
code_country_names,
" Country::{} => \"{}\",",
enum_name, n
);
)
.unwrap();
});
// Add Country::Zz / Global
code_countries += " /// Global (can only be used for music charts)\n";
code_countries += " Zz,\n";
code_country_names += " Country::Zz => \"Global\",\n";
code_countries += "}\n";
code_lang_array += "];\n";

View file

@ -421,7 +421,7 @@ impl RustyPipeBuilder {
///
/// **Info**: you can set this option for individual queries, too
pub fn country(mut self, country: Country) -> Self {
self.default_opts.country = country;
self.default_opts.country = validate_country(country);
self
}
@ -759,7 +759,7 @@ impl RustyPipeQuery {
/// Set the country parameter used when accessing the YouTube API.
/// This will change trends and recommended content.
pub fn country(mut self, country: Country) -> Self {
self.opts.country = country;
self.opts.country = validate_country(country);
self
}
@ -1194,6 +1194,15 @@ trait MapResponse<T> {
) -> Result<MapResult<T>, ExtractionError>;
}
fn validate_country(country: Country) -> Country {
if country == Country::Zz {
warn!("Country:Zz (Global) can only be used for fetching music charts, falling back to Country:Us");
Country::Us
} else {
country
}
}
#[cfg(test)]
mod tests {
use super::*;

View file

@ -5,6 +5,7 @@ use serde::Serialize;
use crate::{
error::{Error, ExtractionError},
model::{MusicCharts, TrackItem},
param::Country,
serializer::MapResult,
};
@ -20,17 +21,17 @@ struct QCharts<'a> {
browse_id: &'a str,
params: &'a str,
#[serde(skip_serializing_if = "Option::is_none")]
form_data: Option<FormData<'a>>,
form_data: Option<FormData>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct FormData<'a> {
pub selected_values: [&'a str; 1],
struct FormData {
pub selected_values: [Country; 1],
}
impl RustyPipeQuery {
pub async fn music_charts(&self, country: Option<&str>) -> Result<MusicCharts, Error> {
pub async fn music_charts(&self, country: Option<Country>) -> Result<MusicCharts, Error> {
let context = self.get_context(ClientType::DesktopMusic, true, None).await;
let request_body = QCharts {
context,
@ -149,9 +150,8 @@ mod tests {
use crate::param::Language;
#[rstest]
#[case::default("default")]
#[case::default("global")]
#[case::us("US")]
#[case::unavailable("unavailable")]
fn map_music_charts(#[case] name: &str) {
let filename = format!("testfiles/music_charts/charts_{}.json", name);
let json_path = Path::new(&filename);

View file

@ -32,7 +32,7 @@ MusicCharts(
],
artist_id: Some("UCiXhCjTprNP0nuQJ9UsLWeg"),
album: None,
view_count: Some(55000000),
view_count: Some(56000000),
is_video: true,
track_nr: None,
),
@ -60,7 +60,7 @@ MusicCharts(
],
artist_id: Some("UCybEdRVR5u_WFoV-BLTEBiA"),
album: None,
view_count: Some(14000000),
view_count: Some(15000000),
is_video: true,
track_nr: None,
),
@ -88,7 +88,7 @@ MusicCharts(
],
artist_id: Some("UCiY3z8HAGD6BlSNKVn2kSvQ"),
album: None,
view_count: Some(518000000),
view_count: Some(521000000),
is_video: true,
track_nr: None,
),
@ -116,7 +116,7 @@ MusicCharts(
],
artist_id: Some("UCWsDFcIhY2DBi3GB5uykGXA"),
album: None,
view_count: Some(33000000),
view_count: Some(34000000),
is_video: true,
track_nr: None,
),
@ -144,7 +144,7 @@ MusicCharts(
],
artist_id: Some("UCiY3z8HAGD6BlSNKVn2kSvQ"),
album: None,
view_count: Some(557000000),
view_count: Some(559000000),
is_video: true,
track_nr: None,
),
@ -172,7 +172,7 @@ MusicCharts(
],
artist_id: Some("UCMXDyVR2tclKWhbqNforSyA"),
album: None,
view_count: Some(38000000),
view_count: Some(39000000),
is_video: true,
track_nr: None,
),
@ -200,7 +200,7 @@ MusicCharts(
],
artist_id: Some("UCJa2FF4TUB13Mm0GurZAqog"),
album: None,
view_count: Some(137000000),
view_count: Some(139000000),
is_video: true,
track_nr: None,
),
@ -228,7 +228,7 @@ MusicCharts(
],
artist_id: Some("UCKRnq8aBOCanYlffje7HyvA"),
album: None,
view_count: Some(309000000),
view_count: Some(311000000),
is_video: true,
track_nr: None,
),
@ -256,7 +256,7 @@ MusicCharts(
],
artist_id: Some("UCR28YDxjDE3ogQROaNdnRbQ"),
album: None,
view_count: Some(3500000),
view_count: Some(3800000),
is_video: true,
track_nr: None,
),
@ -284,7 +284,7 @@ MusicCharts(
],
artist_id: Some("UCpcTrCXblq78GZrTUTLWeBw"),
album: None,
view_count: Some(43000000),
view_count: Some(46000000),
is_video: true,
track_nr: None,
),
@ -312,7 +312,7 @@ MusicCharts(
],
artist_id: Some("UCJa2FF4TUB13Mm0GurZAqog"),
album: None,
view_count: Some(71000000),
view_count: Some(73000000),
is_video: true,
track_nr: None,
),
@ -344,7 +344,7 @@ MusicCharts(
],
artist_id: Some("UCohgH17dyp4c_V7U9LoBLdA"),
album: None,
view_count: Some(76000000),
view_count: Some(77000000),
is_video: true,
track_nr: None,
),
@ -372,7 +372,7 @@ MusicCharts(
],
artist_id: Some("UChWPNW87QHcXAsw2mzlsYNw"),
album: None,
view_count: Some(2500000),
view_count: Some(2600000),
is_video: true,
track_nr: None,
),
@ -400,7 +400,7 @@ MusicCharts(
],
artist_id: Some("UC_z9AthnCGSAk_tZf-KqoFA"),
album: None,
view_count: Some(16000000),
view_count: Some(17000000),
is_video: true,
track_nr: None,
),
@ -436,7 +436,7 @@ MusicCharts(
],
artist_id: Some("UCdPdi8UM25ZyvzhSJkk1uPw"),
album: None,
view_count: Some(8200000),
view_count: Some(8600000),
is_video: true,
track_nr: None,
),
@ -524,7 +524,7 @@ MusicCharts(
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(200000000),
view_count: Some(202000000),
is_video: true,
track_nr: None,
),
@ -552,7 +552,7 @@ MusicCharts(
],
artist_id: Some("UCGJdT8Qip4XObbQZ98Z1CAA"),
album: None,
view_count: Some(4800000),
view_count: Some(4900000),
is_video: true,
track_nr: None,
),
@ -580,7 +580,7 @@ MusicCharts(
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(543000000),
view_count: Some(545000000),
is_video: true,
track_nr: None,
),
@ -644,7 +644,7 @@ MusicCharts(
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(34000000),
view_count: Some(36000000),
is_video: true,
track_nr: None,
),
@ -676,7 +676,7 @@ MusicCharts(
],
artist_id: Some("UCgpBsaDW2n_6ruzht3wvP0A"),
album: None,
view_count: Some(64000000),
view_count: Some(66000000),
is_video: true,
track_nr: None,
),
@ -704,7 +704,7 @@ MusicCharts(
],
artist_id: Some("UCPC0L1d253x-KuMNwa05TpA"),
album: None,
view_count: Some(67000000),
view_count: Some(68000000),
is_video: true,
track_nr: None,
),
@ -732,7 +732,7 @@ MusicCharts(
],
artist_id: Some("UCju-DqP7JNtCnMWFXhLgPHQ"),
album: None,
view_count: Some(45000000),
view_count: Some(46000000),
is_video: true,
track_nr: None,
),
@ -796,7 +796,7 @@ MusicCharts(
],
artist_id: Some("UCoC_a7lWbj2v7rt4ujp4n2A"),
album: None,
view_count: Some(6600000),
view_count: Some(7200000),
is_video: true,
track_nr: None,
),
@ -824,7 +824,7 @@ MusicCharts(
],
artist_id: Some("UCvUZUUxWhwtKLVQ9bVRjLEA"),
album: None,
view_count: Some(3800000),
view_count: Some(4000000),
is_video: true,
track_nr: None,
),
@ -852,7 +852,7 @@ MusicCharts(
],
artist_id: Some("UCr_zAwkma5JAyHOWfVXaouA"),
album: None,
view_count: Some(2700000),
view_count: Some(2900000),
is_video: true,
track_nr: None,
),
@ -912,7 +912,7 @@ MusicCharts(
],
artist_id: Some("UCBabNBocAdKiN5sz8RBjIDg"),
album: None,
view_count: Some(14000000),
view_count: Some(15000000),
is_video: true,
track_nr: None,
),
@ -996,7 +996,7 @@ MusicCharts(
],
artist_id: Some("UC_VCJd8skzwcPktsMLqTz1g"),
album: None,
view_count: Some(33000000),
view_count: Some(35000000),
is_video: true,
track_nr: None,
),
@ -1032,7 +1032,7 @@ MusicCharts(
],
artist_id: None,
album: None,
view_count: Some(29000000),
view_count: Some(30000000),
is_video: true,
track_nr: None,
),
@ -1088,7 +1088,7 @@ MusicCharts(
],
artist_id: Some("UChWPNW87QHcXAsw2mzlsYNw"),
album: None,
view_count: Some(5200000),
view_count: Some(5400000),
is_video: true,
track_nr: None,
),
@ -1116,7 +1116,7 @@ MusicCharts(
],
artist_id: Some("UCiY3z8HAGD6BlSNKVn2kSvQ"),
album: None,
view_count: Some(311000000),
view_count: Some(312000000),
is_video: true,
track_nr: None,
),
@ -1178,29 +1178,6 @@ MusicCharts(
),
],
trending_tracks: [
TrackItem(
id: "UhbixyxgsiU",
title: "Just Wanna Rock",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/UhbixyxgsiU/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3lWnqsueoNRp5ldKs9SqfiFE5KzOw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCybEdRVR5u_WFoV-BLTEBiA"),
name: "Lil Uzi Vert",
),
],
artist_id: Some("UCybEdRVR5u_WFoV-BLTEBiA"),
album: None,
view_count: Some(14000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "_u-7rWKnVVo",
title: "Metallica: Lux Æterna (Official Music Video)",
@ -1220,126 +1197,53 @@ MusicCharts(
],
artist_id: Some("UCGexNm_Kw4rdQjLxmpb2EKw"),
album: None,
view_count: Some(3800000),
view_count: Some(6000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "rb0bjyt1OD0",
title: "Tukoh Taka - Official FIFA Fan Festival™ Anthem | Nicki Minaj, Maluma, & Myriam Fares (FIFA Sound)",
id: "UhbixyxgsiU",
title: "Just Wanna Rock",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/rb0bjyt1OD0/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3ncdZ5k8f--HAeT1TqtTvVtqv6WGw",
url: "https://i.ytimg.com/vi/UhbixyxgsiU/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3lWnqsueoNRp5ldKs9SqfiFE5KzOw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCpcTrCXblq78GZrTUTLWeBw"),
name: "FIFA",
id: Some("UCybEdRVR5u_WFoV-BLTEBiA"),
name: "Lil Uzi Vert",
),
],
artist_id: Some("UCpcTrCXblq78GZrTUTLWeBw"),
artist_id: Some("UCybEdRVR5u_WFoV-BLTEBiA"),
album: None,
view_count: Some(43000000),
view_count: Some(15000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "C2YSX4sV_bA",
title: "Letter to Takeoff",
id: "zugAhfd2r0g",
title: "ITZY “Cheshire” M/V @ITZY",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/C2YSX4sV_bA/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3n9DRpudRbYWOgj75luejwwGHxueg",
url: "https://i.ytimg.com/vi/zugAhfd2r0g/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3mxspXDnjGAzWswBkJ81HpSmn-ouQ",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCGJdT8Qip4XObbQZ98Z1CAA"),
name: "Gucci Mane",
id: Some("UCTP45_DE3fMLujU8sZ-MBzw"),
name: "ITZY",
),
],
artist_id: Some("UCGJdT8Qip4XObbQZ98Z1CAA"),
artist_id: Some("UCTP45_DE3fMLujU8sZ-MBzw"),
album: None,
view_count: Some(4800000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "3V8aen7Flhs",
title: "Hi Haters",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/3V8aen7Flhs/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3l1WGtkmSlwXNalDWwLoD-SETEpeg",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCR28YDxjDE3ogQROaNdnRbQ"),
name: "YoungBoy Never Broke Again",
),
],
artist_id: Some("UCR28YDxjDE3ogQROaNdnRbQ"),
album: None,
view_count: Some(3500000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "Z02zptUN8gI",
title: "Cairo",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/Z02zptUN8gI/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3n5PM92iiicNOImj3j8IEpxlSM41w",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
name: "KAROL G",
),
ArtistId(
id: Some("UCtfkGa4ie0BivwCPWCHalOw"),
name: "Ovy On The Drums",
),
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(34000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "9YdgldMKGGU",
title: "Get Away (Official Visualizer)",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/9YdgldMKGGU/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nA1er-0A6lGpG41Z5hEslKmZKjnQ",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCvUZUUxWhwtKLVQ9bVRjLEA"),
name: "Young Dolph",
),
],
artist_id: Some("UCvUZUUxWhwtKLVQ9bVRjLEA"),
album: None,
view_count: Some(3800000),
view_count: Some(10000000),
is_video: true,
track_nr: None,
),
@ -1366,30 +1270,76 @@ MusicCharts(
],
artist_id: Some("UC_duTRnaqtLLTCDIlqjRTcQ"),
album: None,
view_count: Some(3100000),
view_count: Some(3600000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "J9QwBwUnhQo",
title: "Got It Right",
id: "VMZefv4Vrwg",
title: "Nas ft. @21 Savage - One Mic, One Gun (Official Audio)",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/J9QwBwUnhQo/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3mfATJfiIMnKSBx8F2YbRQp3xyc2Q",
url: "https://i.ytimg.com/vi/VMZefv4Vrwg/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nDDFunbQ6iNTG-rjzJWKxtH7nfEw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UChWPNW87QHcXAsw2mzlsYNw"),
name: "Rod Wave",
id: Some("UCPoQYATXIYvN5WB0c4f6jfQ"),
name: "Nas",
),
],
artist_id: Some("UChWPNW87QHcXAsw2mzlsYNw"),
artist_id: Some("UCPoQYATXIYvN5WB0c4f6jfQ"),
album: None,
view_count: Some(2500000),
view_count: Some(524000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "3V8aen7Flhs",
title: "Hi Haters",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/3V8aen7Flhs/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3l1WGtkmSlwXNalDWwLoD-SETEpeg",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCR28YDxjDE3ogQROaNdnRbQ"),
name: "YoungBoy Never Broke Again",
),
],
artist_id: Some("UCR28YDxjDE3ogQROaNdnRbQ"),
album: None,
view_count: Some(3800000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "rb0bjyt1OD0",
title: "Tukoh Taka - Official FIFA Fan Festival™ Anthem | Nicki Minaj, Maluma, & Myriam Fares (FIFA Sound)",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/rb0bjyt1OD0/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3ncdZ5k8f--HAeT1TqtTvVtqv6WGw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCpcTrCXblq78GZrTUTLWeBw"),
name: "FIFA",
),
],
artist_id: Some("UCpcTrCXblq78GZrTUTLWeBw"),
album: None,
view_count: Some(46000000),
is_video: true,
track_nr: None,
),
@ -1412,30 +1362,99 @@ MusicCharts(
],
artist_id: Some("UCEf_Bc-KVd7onSeifS3py9g"),
album: None,
view_count: Some(5500000),
view_count: Some(8300000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "QbsfUkogRbA",
title: "Fuerza Regida x Grupo Frontera - 911 [Official Video]",
id: "rAr3-Pn9yRI",
title: "JS4E",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/QbsfUkogRbA/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nGoXX1unLacrhDydChgi2bCmdK8w",
url: "https://i.ytimg.com/vi/rAr3-Pn9yRI/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kly3hLnWJDXiVjIsmMaOXcDxLNaw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UC648rgJOboZlgcDbW00vTSA"),
name: "Rancho Humilde",
id: Some("UCVcAt8IIKIeubRSigcYXgtA"),
name: "Arcangel",
),
],
artist_id: Some("UC648rgJOboZlgcDbW00vTSA"),
artist_id: Some("UCVcAt8IIKIeubRSigcYXgtA"),
album: None,
view_count: Some(2600000),
view_count: Some(13000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "PtPewTyPmUg",
title: "Jelly Roll - \"she\" (Official Audio)",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/PtPewTyPmUg/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3m5R7TWFjNK7-BpJjFwjisaBkqOQw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UC0_1glf30IS53tFQWT8xpxw"),
name: "Jelly Roll",
),
],
artist_id: Some("UC0_1glf30IS53tFQWT8xpxw"),
album: None,
view_count: Some(365000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "G6xgMW7U0aY",
title: "712PM (Directed by Travis Scott)",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/G6xgMW7U0aY/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kqka_hIsTpEmePMEKQ5Nc3j07QtA",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UC1_liDR4fRFJgH4HoJeV8cw"),
name: "Future",
),
],
artist_id: Some("UC1_liDR4fRFJgH4HoJeV8cw"),
album: None,
view_count: Some(754000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "C2YSX4sV_bA",
title: "Letter to Takeoff",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/C2YSX4sV_bA/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3n9DRpudRbYWOgj75luejwwGHxueg",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCGJdT8Qip4XObbQZ98Z1CAA"),
name: "Gucci Mane",
),
],
artist_id: Some("UCGJdT8Qip4XObbQZ98Z1CAA"),
album: None,
view_count: Some(4900000),
is_video: true,
track_nr: None,
),
@ -1458,17 +1477,67 @@ MusicCharts(
],
artist_id: Some("UCr_zAwkma5JAyHOWfVXaouA"),
album: None,
view_count: Some(2700000),
view_count: Some(2900000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "rAr3-Pn9yRI",
title: "Arcangel - JS4E (Video Oficial) | SR. SANTOS",
id: "9YdgldMKGGU",
title: "Get Away (Official Visualizer)",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/rAr3-Pn9yRI/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kly3hLnWJDXiVjIsmMaOXcDxLNaw",
url: "https://i.ytimg.com/vi/9YdgldMKGGU/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nA1er-0A6lGpG41Z5hEslKmZKjnQ",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCvUZUUxWhwtKLVQ9bVRjLEA"),
name: "Young Dolph",
),
],
artist_id: Some("UCvUZUUxWhwtKLVQ9bVRjLEA"),
album: None,
view_count: Some(4000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "Z02zptUN8gI",
title: "Cairo",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/Z02zptUN8gI/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3n5PM92iiicNOImj3j8IEpxlSM41w",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
name: "KAROL G",
),
ArtistId(
id: Some("UCtfkGa4ie0BivwCPWCHalOw"),
name: "Ovy On The Drums",
),
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(36000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "S0_888ZjlAA",
title: "Arcangel, Bad Bunny - La Jumpa (Visualizer) | SR. SANTOS",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/S0_888ZjlAA/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3lpnyYRv3y1AjIhKjerd7Il4IpV_Q",
width: 400,
height: 225,
),
@ -1481,44 +1550,17 @@ MusicCharts(
],
artist_id: Some("UCVcAt8IIKIeubRSigcYXgtA"),
album: None,
view_count: Some(11000000),
view_count: Some(2000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "PrSBuEFdRFU",
title: "Rich Flex",
id: "J9QwBwUnhQo",
title: "Got It Right",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/PrSBuEFdRFU/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3mOdvdIBi63Unzs2A-Lf6rnKcF34A",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCoC_a7lWbj2v7rt4ujp4n2A"),
name: "21 Savage",
),
ArtistId(
id: Some("UCU6cE7pdJPc6DU2jSrKEsdQ"),
name: "Drake",
),
],
artist_id: Some("UCoC_a7lWbj2v7rt4ujp4n2A"),
album: None,
view_count: Some(6600000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "lkO6rffobPA",
title: "Love Overdose",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/lkO6rffobPA/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nylgzdkKfP-ke7Bso1XfcbDk6PYA",
url: "https://i.ytimg.com/vi/J9QwBwUnhQo/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3mfATJfiIMnKSBx8F2YbRQp3xyc2Q",
width: 400,
height: 225,
),
@ -1531,126 +1573,84 @@ MusicCharts(
],
artist_id: Some("UChWPNW87QHcXAsw2mzlsYNw"),
album: None,
view_count: Some(932000),
view_count: Some(2600000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "zVHZCe6Slnw",
title: "Jupiter\'s Diary",
id: "DWRj2BB8YHs",
title: "AMG",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/zVHZCe6Slnw/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nvwvyT3gL7uwzlhOnRj-tiUoHMHg",
url: "https://i.ytimg.com/vi/DWRj2BB8YHs/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3ltENgg6cgpfI8XbL67cH3pvtgrSg",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UChWPNW87QHcXAsw2mzlsYNw"),
name: "Rod Wave",
id: None,
name: "Peso Pluma",
),
ArtistId(
id: None,
name: "Natanael Cano",
),
ArtistId(
id: None,
name: "Gabito Ballesteros",
),
],
artist_id: Some("UChWPNW87QHcXAsw2mzlsYNw"),
artist_id: Some("UC47k7qXysCBKeaYfc1zmkIA"),
album: None,
view_count: Some(969000),
view_count: Some(3500000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "jEdfjuG0Fx4",
title: "정국 (Jung Kook) \'Dreamers\' @ FIFA World Cup Qatar 2022 Opening Ceremony",
id: "hX0aI5Jz8i8",
title: "Texas",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/jEdfjuG0Fx4/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3lQuqDttsinX7YGKdOA0k3Tjafu8g",
url: "https://i.ytimg.com/vi/hX0aI5Jz8i8/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nSaDuTFMLQAGiqmBYrhzW2fo73JA",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UC9vrvNSL3xcWGSkV86REBSg"),
name: "BTS",
),
ArtistId(
id: Some("UC-pOuHFcndLpyfWSPVqXt_A"),
name: "Jung Kook",
id: Some("UCjfB7ooJY7C43vBAuuCub_A"),
name: "BigXthaPlug",
),
],
artist_id: Some("UC9vrvNSL3xcWGSkV86REBSg"),
artist_id: Some("UCjfB7ooJY7C43vBAuuCub_A"),
album: None,
view_count: Some(43000000),
view_count: Some(367000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "DGCSk7aCI-Y",
title: "Who Got It",
id: "Dw9VmOLwxoM",
title: "Thought You Should Know (Official Music Video)",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/DGCSk7aCI-Y/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3lxqsVAyek5ddQD71QVwdJ8n8EUxg",
url: "https://i.ytimg.com/vi/Dw9VmOLwxoM/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3kB2qpv15Td1WLyXkhZY7FBiO_sgw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCkrmjqtFNzQQop4wHYvXhDA"),
name: "Big Homiie G",
id: Some("UC5xaQ6_dP7EGDmGLzVGZ1Ow"),
name: "Morgan Wallen",
),
],
artist_id: Some("UCkrmjqtFNzQQop4wHYvXhDA"),
artist_id: Some("UC5xaQ6_dP7EGDmGLzVGZ1Ow"),
album: None,
view_count: Some(1700000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "0LmtIWvo0ZQ",
title: "Destination",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/0LmtIWvo0ZQ/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3lqSkqqYQDuPuWoeVQo4z-WS8eQEw",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCdWj-05ljTjLPllS6GGq5Mg"),
name: "Crash Adams",
),
],
artist_id: Some("UCdWj-05ljTjLPllS6GGq5Mg"),
album: None,
view_count: Some(33000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "toBTPGfurLc",
title: "Rich Spirit",
duration: None,
cover: [
Thumbnail(
url: "https://i.ytimg.com/vi/toBTPGfurLc/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3lVnzF0UrvMG_J6EN-WLyywbX3neA",
width: 400,
height: 225,
),
],
artists: [
ArtistId(
id: Some("UCprAFmT0C6O4X0ToEXpeFTQ"),
name: "Kendrick Lamar",
),
],
artist_id: Some("UCprAFmT0C6O4X0ToEXpeFTQ"),
album: None,
view_count: Some(6600000),
view_count: Some(1500000),
is_video: true,
track_nr: None,
),
@ -2555,5 +2555,6 @@ MusicCharts(
UY,
ZA,
ZW,
ZZ,
],
)

View file

@ -28,7 +28,7 @@ MusicCharts(
],
artist_id: Some("UCpcTrCXblq78GZrTUTLWeBw"),
album: None,
view_count: Some(43000000),
view_count: Some(46000000),
is_video: true,
track_nr: None,
),
@ -60,7 +60,7 @@ MusicCharts(
],
artist_id: Some("UC9vrvNSL3xcWGSkV86REBSg"),
album: None,
view_count: Some(43000000),
view_count: Some(46000000),
is_video: true,
track_nr: None,
),
@ -120,7 +120,7 @@ MusicCharts(
],
artist_id: Some("UCONiUl5u7y2bMaVZJcuRDEQ"),
album: None,
view_count: Some(37000000),
view_count: Some(38000000),
is_video: true,
track_nr: None,
),
@ -152,7 +152,7 @@ MusicCharts(
],
artist_id: None,
album: None,
view_count: Some(54000000),
view_count: Some(57000000),
is_video: true,
track_nr: None,
),
@ -180,7 +180,7 @@ MusicCharts(
],
artist_id: Some("UCiY3z8HAGD6BlSNKVn2kSvQ"),
album: None,
view_count: Some(518000000),
view_count: Some(521000000),
is_video: true,
track_nr: None,
),
@ -212,7 +212,7 @@ MusicCharts(
],
artist_id: Some("UC5p07Pr3hlfjXo3YGVCyOgg"),
album: None,
view_count: Some(74000000),
view_count: Some(76000000),
is_video: true,
track_nr: None,
),
@ -240,7 +240,7 @@ MusicCharts(
],
artist_id: Some("UCfh2j2Dq-aSeLhzuPOsnhVg"),
album: None,
view_count: Some(274000000),
view_count: Some(276000000),
is_video: true,
track_nr: None,
),
@ -272,7 +272,7 @@ MusicCharts(
],
artist_id: Some("UCeBYRgPhy8kcRmIGQWKuqdQ"),
album: None,
view_count: Some(134000000),
view_count: Some(136000000),
is_video: true,
track_nr: None,
),
@ -300,7 +300,7 @@ MusicCharts(
],
artist_id: Some("UCiY3z8HAGD6BlSNKVn2kSvQ"),
album: None,
view_count: Some(557000000),
view_count: Some(559000000),
is_video: true,
track_nr: None,
),
@ -328,7 +328,7 @@ MusicCharts(
],
artist_id: Some("UCDxKh1gFWeYsqePvgVzmPoQ"),
album: None,
view_count: Some(329000000),
view_count: Some(331000000),
is_video: true,
track_nr: None,
),
@ -356,7 +356,7 @@ MusicCharts(
],
artist_id: Some("UCkbbMCA40i18i7UdjayMPAg"),
album: None,
view_count: Some(255000000),
view_count: Some(257000000),
is_video: true,
track_nr: None,
),
@ -388,7 +388,7 @@ MusicCharts(
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(34000000),
view_count: Some(36000000),
is_video: true,
track_nr: None,
),
@ -428,7 +428,7 @@ MusicCharts(
],
artist_id: Some("UCKEFjh4JL-OyMI8z3h5Coaw"),
album: None,
view_count: Some(49000000),
view_count: Some(50000000),
is_video: true,
track_nr: None,
),
@ -460,7 +460,7 @@ MusicCharts(
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(200000000),
view_count: Some(202000000),
is_video: true,
track_nr: None,
),
@ -488,7 +488,7 @@ MusicCharts(
],
artist_id: Some("UCKNGMXJHTiGFdZNSo_zs3fQ"),
album: None,
view_count: Some(101000000),
view_count: Some(103000000),
is_video: true,
track_nr: None,
),
@ -516,13 +516,13 @@ MusicCharts(
],
artist_id: Some("UCkbbMCA40i18i7UdjayMPAg"),
album: None,
view_count: Some(451000000),
view_count: Some(453000000),
is_video: true,
track_nr: None,
),
TrackItem(
id: "D0gWr9K8Lb4",
title: "Chann Sitare | Oye Makhna | Ammy Virk | Tania | Simerjit Singh | Avvy Sra |New Punjabi Songs 2022",
title: "Chann Sitare",
duration: None,
cover: [
Thumbnail(
@ -538,13 +538,13 @@ MusicCharts(
],
artists: [
ArtistId(
id: Some("UCSdWkYk9pk3DHTXbof_R7XQ"),
name: "Saregama Punjabi",
id: Some("UCUamzwxCTrUvpyAvAt4FEdg"),
name: "Ammy Virk",
),
],
artist_id: Some("UCSdWkYk9pk3DHTXbof_R7XQ"),
artist_id: Some("UCUamzwxCTrUvpyAvAt4FEdg"),
album: None,
view_count: Some(42000000),
view_count: Some(44000000),
is_video: true,
track_nr: None,
),
@ -572,7 +572,7 @@ MusicCharts(
],
artist_id: Some("UCKEFjh4JL-OyMI8z3h5Coaw"),
album: None,
view_count: Some(79000000),
view_count: Some(81000000),
is_video: true,
track_nr: None,
),
@ -600,7 +600,7 @@ MusicCharts(
],
artist_id: Some("UCJa2FF4TUB13Mm0GurZAqog"),
album: None,
view_count: Some(71000000),
view_count: Some(73000000),
is_video: true,
track_nr: None,
),
@ -628,7 +628,7 @@ MusicCharts(
],
artist_id: Some("UC6uMb9hMAziN9HZoXfTBAlg"),
album: None,
view_count: Some(43000000),
view_count: Some(45000000),
is_video: true,
track_nr: None,
),
@ -656,7 +656,7 @@ MusicCharts(
],
artist_id: Some("UC7n3gWRN0vQzgiOKc51aZ4w"),
album: None,
view_count: Some(543000000),
view_count: Some(545000000),
is_video: true,
track_nr: None,
),
@ -684,7 +684,7 @@ MusicCharts(
],
artist_id: Some("UCJa2FF4TUB13Mm0GurZAqog"),
album: None,
view_count: Some(137000000),
view_count: Some(139000000),
is_video: true,
track_nr: None,
),
@ -712,7 +712,7 @@ MusicCharts(
],
artist_id: Some("UCeYz6rzUGhVwqxRM37FUo8w"),
album: None,
view_count: Some(195000000),
view_count: Some(197000000),
is_video: true,
track_nr: None,
),
@ -733,18 +733,18 @@ MusicCharts(
),
],
artists: [
ArtistId(
id: Some("UCeBYRgPhy8kcRmIGQWKuqdQ"),
name: "Selena Gomez",
),
ArtistId(
id: Some("UCy6qn2oxmoXA4_gBA5Q7zPw"),
name: "Rema",
),
ArtistId(
id: Some("UCeBYRgPhy8kcRmIGQWKuqdQ"),
name: "Selena Gomez",
),
],
artist_id: Some("UCeBYRgPhy8kcRmIGQWKuqdQ"),
artist_id: Some("UCy6qn2oxmoXA4_gBA5Q7zPw"),
album: None,
view_count: Some(255000000),
view_count: Some(257000000),
is_video: true,
track_nr: None,
),
@ -772,7 +772,7 @@ MusicCharts(
],
artist_id: Some("UCybEdRVR5u_WFoV-BLTEBiA"),
album: None,
view_count: Some(14000000),
view_count: Some(15000000),
is_video: true,
track_nr: None,
),
@ -800,7 +800,7 @@ MusicCharts(
],
artist_id: Some("UCtGHTwNL20Y3fY9bumjHDOw"),
album: None,
view_count: Some(53000000),
view_count: Some(55000000),
is_video: true,
track_nr: None,
),
@ -828,7 +828,7 @@ MusicCharts(
],
artist_id: Some("UCWsDFcIhY2DBi3GB5uykGXA"),
album: None,
view_count: Some(33000000),
view_count: Some(34000000),
is_video: true,
track_nr: None,
),
@ -860,7 +860,7 @@ MusicCharts(
],
artist_id: Some("UCo6JijJGA3IvIiPsawDK3Ww"),
album: None,
view_count: Some(121000000),
view_count: Some(123000000),
is_video: true,
track_nr: None,
),
@ -888,7 +888,7 @@ MusicCharts(
],
artist_id: Some("UCc3e8O2V5_7OA300ursDyFQ"),
album: None,
view_count: Some(107000000),
view_count: Some(109000000),
is_video: true,
track_nr: None,
),
@ -944,7 +944,7 @@ MusicCharts(
],
artist_id: Some("UC03jIQv4WXBSHdr1DlCLYDw"),
album: None,
view_count: Some(871000000),
view_count: Some(872000000),
is_video: true,
track_nr: None,
),
@ -1000,7 +1000,7 @@ MusicCharts(
],
artist_id: Some("UCo6JijJGA3IvIiPsawDK3Ww"),
album: None,
view_count: Some(748000000),
view_count: Some(750000000),
is_video: true,
track_nr: None,
),
@ -1028,7 +1028,7 @@ MusicCharts(
],
artist_id: Some("UCKRnq8aBOCanYlffje7HyvA"),
album: None,
view_count: Some(309000000),
view_count: Some(311000000),
is_video: true,
track_nr: None,
),
@ -1064,7 +1064,7 @@ MusicCharts(
],
artist_id: Some("UCQK0swJm0ceapSOtRKIWr0g"),
album: None,
view_count: Some(36000000),
view_count: Some(37000000),
is_video: true,
track_nr: None,
),
@ -1096,7 +1096,7 @@ MusicCharts(
],
artist_id: Some("UC7PL9aor5qNRhvhWWVXyOqA"),
album: None,
view_count: Some(376000000),
view_count: Some(377000000),
is_video: true,
track_nr: None,
),
@ -1156,7 +1156,7 @@ MusicCharts(
],
artist_id: Some("UCrP3Rfz32MT-OH9MZh_N9kA"),
album: None,
view_count: Some(568000000),
view_count: Some(570000000),
is_video: true,
track_nr: None,
),
@ -1184,7 +1184,7 @@ MusicCharts(
],
artist_id: Some("UC0QVToeCjC9-1u-teWToPsg"),
album: None,
view_count: Some(27000000),
view_count: Some(28000000),
is_video: true,
track_nr: None,
),
@ -1937,5 +1937,6 @@ MusicCharts(
UY,
ZA,
ZW,
ZZ,
],
)

View file

@ -412,6 +412,8 @@ pub enum Country {
Za,
/// Zimbabwe
Zw,
/// Global (can only be used for music charts)
Zz,
}
/// Array of all available languages
@ -822,6 +824,7 @@ impl Country {
Country::Ye => "Yemen",
Country::Za => "South Africa",
Country::Zw => "Zimbabwe",
Country::Zz => "Global",
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff