Compare commits

...

3 commits

Author SHA1 Message Date
ca2335d03f fix: parsing playlist channel
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
(more than 1 text component led to an error)
2023-07-30 18:02:06 +02:00
687ddec50d fix: make error enums exhaustive 2023-07-30 17:02:03 +02:00
9d385e8e9b fix: player from android client 2023-07-30 17:00:47 +02:00
5 changed files with 7 additions and 12 deletions

View file

@ -40,6 +40,8 @@ struct QPlayer<'a> {
content_check_ok: bool, content_check_ok: bool,
/// Probably refers to allowing sensitive content, too /// Probably refers to allowing sensitive content, too
racy_check_ok: bool, racy_check_ok: bool,
#[serde(skip_serializing_if = "Option::is_none")]
params: Option<&'a str>,
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
@ -113,6 +115,7 @@ impl RustyPipeQuery {
video_id, video_id,
content_check_ok: true, content_check_ok: true,
racy_check_ok: true, racy_check_ok: true,
params: None,
} }
} else { } else {
QPlayer { QPlayer {
@ -122,6 +125,8 @@ impl RustyPipeQuery {
video_id, video_id,
content_check_ok: true, content_check_ok: true,
racy_check_ok: true, racy_check_ok: true,
// Source: https://github.com/TeamNewPipe/NewPipeExtractor/pull/1084
params: Some("CgIQBg").filter(|_| client_type == ClientType::Android),
} }
}; };

View file

@ -6,7 +6,6 @@ use reqwest::StatusCode;
/// Error type for the RustyPipe library /// Error type for the RustyPipe library
#[derive(thiserror::Error, Debug)] #[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum Error { pub enum Error {
/// Error extracting content from YouTube /// Error extracting content from YouTube
#[error("extraction error: {0}")] #[error("extraction error: {0}")]
@ -24,7 +23,6 @@ pub enum Error {
/// Error extracting content from YouTube /// Error extracting content from YouTube
#[derive(thiserror::Error, Debug)] #[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum ExtractionError { pub enum ExtractionError {
/// Video cannot be extracted with RustyPipe /// Video cannot be extracted with RustyPipe
/// ///

View file

@ -201,13 +201,6 @@ impl<'de> Deserialize<'de> for TextComponent {
D: Deserializer<'de>, D: Deserializer<'de>,
{ {
let mut text = RichTextInternal::deserialize(deserializer)?; let mut text = RichTextInternal::deserialize(deserializer)?;
if text.runs.len() != 1 {
return Err(serde::de::Error::invalid_length(
text.runs.len(),
&"1 run, use TextComponents for more",
));
}
Ok(text.runs.swap_remove(0).into()) Ok(text.runs.swap_remove(0).into())
} }
} }

View file

@ -6,7 +6,7 @@ MusicArtist(
id: "UCfwCE5VhPMGxNPFxtVv7lRw", id: "UCfwCE5VhPMGxNPFxtVv7lRw",
name: "Sulli", name: "Sulli",
header_image: "[header_image]", header_image: "[header_image]",
description: Some("Choi Jin-ri, better known by her stage name Sulli, was a South Korean actress and singer. She first made her debut as a child actress, appearing as a supporting cast member on the SBS historical drama Ballad of Seodong. Following this, she earned a number of guest roles, appearing in the television series Love Needs a Miracle and Drama City, and the film Vacation. She then subsequently appeared in the independent films Punch Lady and BA:BO, the former being her first time cast in a substantial dramatic role.\nAfter signing a record deal with SM Entertainment, Sulli rose to prominence as a member of the girl group f(x) formed in 2009. The group achieved both critical and commercial success, with four Korean number-one singles and international recognition after becoming the first K-pop act to perform at SXSW. Concurrently with her music career, Sulli returned to acting by starring in the SBS romantic comedy series, To the Beautiful You, a Korean adaptation of the shōjo manga Hana-Kimi where her performance was positively received and earned her two SBS Drama Awards and a nomination at the 49th Paeksang Arts Awards.\n\nFrom Wikipedia (https://en.wikipedia.org/wiki/Sulli) under Creative Commons Attribution CC-BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/legalcode)"), description: Some("Choi Jin-ri, better known by her stage name Sulli, was a South Korean singer and actress. She first made her debut as a child actress, appearing as a supporting cast member on the SBS historical drama Ballad of Seodong. Following this, she earned a number of guest roles, appearing in the television series Love Needs a Miracle and Drama City, and the film Vacation. She then subsequently appeared in the independent films Punch Lady and BA:BO, the former being her first time cast in a substantial dramatic role.\nAfter signing a record deal with SM Entertainment, Sulli rose to prominence as a member of the girl group f(x) formed in 2009. The group achieved both critical and commercial success, with four Korean number-one singles and international recognition after becoming the first K-pop act to perform at SXSW. Concurrently with her music career, Sulli returned to acting by starring in the SBS romantic comedy series, To the Beautiful You, a Korean adaptation of the shōjo manga Hana-Kimi where her performance was positively received and earned her two SBS Drama Awards and a nomination at the 49th Paeksang Arts Awards.\n\nFrom Wikipedia (https://en.wikipedia.org/wiki/Sulli) under Creative Commons Attribution CC-BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/legalcode)"),
wikipedia_url: Some("https://en.wikipedia.org/wiki/Sulli"), wikipedia_url: Some("https://en.wikipedia.org/wiki/Sulli"),
subscriber_count: "[subscriber_count]", subscriber_count: "[subscriber_count]",
tracks: "[tracks]", tracks: "[tracks]",

View file

@ -28,8 +28,7 @@ use rustypipe::param::{
#[rstest] #[rstest]
#[case::desktop(ClientType::Desktop)] #[case::desktop(ClientType::Desktop)]
#[case::tv_html5_embed(ClientType::TvHtml5Embed)] #[case::tv_html5_embed(ClientType::TvHtml5Embed)]
// The Android client became flaky #[case::android(ClientType::Android)]
// #[case::android(ClientType::Android)]
#[case::ios(ClientType::Ios)] #[case::ios(ClientType::Ios)]
#[test_log::test] #[test_log::test]
fn get_player_from_client(#[case] client_type: ClientType, rp: RustyPipe) { fn get_player_from_client(#[case] client_type: ClientType, rp: RustyPipe) {