diff --git a/src/client/channel_rss.rs b/src/client/channel_rss.rs index ca78521..8153755 100644 --- a/src/client/channel_rss.rs +++ b/src/client/channel_rss.rs @@ -25,9 +25,9 @@ impl RustyPipeQuery { .http_request_txt(self.client.inner.http.get(&url).build()?) .await .map_err(|e| match e { - Error::HttpStatus(404, _) => Error::Extraction( - ExtractionError::ContentUnavailable("Channel not found".into()), - ), + Error::HttpStatus(404) => Error::Extraction(ExtractionError::ContentUnavailable( + "Channel not found".into(), + )), _ => e, })?; diff --git a/src/client/mod.rs b/src/client/mod.rs index b454b8e..93ab2ed 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -538,7 +538,7 @@ impl RustyPipe { let status = res.status(); if status.is_client_error() || status.is_server_error() { - Err(Error::HttpStatus(status.into(), "none".into())) + Err(Error::HttpStatus(status.into())) } else { Ok(res) } @@ -1086,18 +1086,26 @@ impl RustyPipeQuery { }; if status.is_client_error() || status.is_server_error() { - let error_msg = serde_json::from_str::(&resp_str) - .map(|r| r.error.message) - .unwrap_or_default(); + let status_code = status.as_u16(); return match status { StatusCode::NOT_FOUND => Err(Error::Extraction( - ExtractionError::ContentUnavailable(error_msg.into()), + ExtractionError::ContentUnavailable("404 Not found".into()), )), - StatusCode::BAD_REQUEST => Err(Error::Extraction(ExtractionError::BadRequest( - error_msg.into(), - ))), - _ => Err(Error::HttpStatus(status.as_u16(), error_msg.into())), + StatusCode::BAD_REQUEST => { + let error_res = serde_json::from_str::(&resp_str); + Err(Error::Extraction(ExtractionError::BadRequest( + error_res + .map(|r| r.error.message) + .unwrap_or_default() + .into(), + ))) + } + _ => { + let e = Error::HttpStatus(status_code); + create_report(Level::ERR, Some(e.to_string()), vec![]); + Err(e) + } }; } diff --git a/src/client/music_artist.rs b/src/client/music_artist.rs index 12e79d4..b16dab4 100644 --- a/src/client/music_artist.rs +++ b/src/client/music_artist.rs @@ -166,7 +166,7 @@ fn map_artist_page( lang: crate::param::Language, skip_extendables: bool, ) -> Result)>, ExtractionError> { - // dbg!(&res); + // dbg!(&self); let header = res.header.music_immersive_header_renderer; @@ -272,13 +272,6 @@ fn map_artist_page( .map(|m| m.as_str().to_owned()) }); - let radio_id = header.start_radio_button.and_then(|b| { - b.button_renderer - .navigation_endpoint - .watch_endpoint - .and_then(|w| w.playlist_id) - }); - Ok(MapResult { c: ( MusicArtist { @@ -299,7 +292,6 @@ fn map_artist_page( similar_artists: mapped.c.artists, tracks_playlist_id, videos_playlist_id, - radio_id, }, album_page_params, ), diff --git a/src/client/response/music_artist.rs b/src/client/response/music_artist.rs index e27f3a0..811432b 100644 --- a/src/client/response/music_artist.rs +++ b/src/client/response/music_artist.rs @@ -5,7 +5,7 @@ use crate::serializer::text::Text; use super::{ music_item::{ - Button, Grid, ItemSection, MusicThumbnailRenderer, SimpleHeader, SingleColumnBrowseResult, + Grid, ItemSection, MusicThumbnailRenderer, SimpleHeader, SingleColumnBrowseResult, }, SectionList, Tab, }; @@ -41,9 +41,6 @@ pub(crate) struct MusicHeaderRenderer { #[serde(default)] #[serde_as(as = "DefaultOnError")] pub share_endpoint: Option, - #[serde(default)] - #[serde_as(as = "DefaultOnError")] - pub start_radio_button: Option