From 27f64fc412e833d5bd19ad72913aae19358e98b9 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sun, 5 Jan 2025 03:58:05 +0100 Subject: [PATCH] feat: add method to get saved_playlists --- src/client/history.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/client/history.rs b/src/client/history.rs index cc0f874..2dddc2b 100644 --- a/src/client/history.rs +++ b/src/client/history.rs @@ -7,7 +7,7 @@ use crate::{ error::{Error, ExtractionError}, model::{ paginator::{ContinuationEndpoint, Paginator}, - ChannelItem, HistoryItem, VideoItem, + ChannelItem, HistoryItem, PlaylistItem, VideoItem, }, serializer::MapResult, }; @@ -134,6 +134,18 @@ impl RustyPipeQuery { ) .await } + + /// Get a list of YouTube playlists the current user added to their library + pub async fn saved_playlists(&self) -> Result, Error> { + self.clone() + .authenticated() + .continuation( + "4qmFsgJFEhZGRXBsYXlsaXN0X2FnZ3JlZ2F0aW9uGgRxQUlDmgIkNjc5MjVhZTYtMDAwMC0yYzQyLWFjMjItM2MyODZkNDI1MTQy", + ContinuationEndpoint::Browse, + None, + ) + .await + } } impl MapResponse>> for response::History {