feat: add method to get saved_playlists

This commit is contained in:
ThetaDev 2025-01-05 03:58:05 +01:00
parent 97c3f30d18
commit 27f64fc412
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6

View file

@ -7,7 +7,7 @@ use crate::{
error::{Error, ExtractionError}, error::{Error, ExtractionError},
model::{ model::{
paginator::{ContinuationEndpoint, Paginator}, paginator::{ContinuationEndpoint, Paginator},
ChannelItem, HistoryItem, VideoItem, ChannelItem, HistoryItem, PlaylistItem, VideoItem,
}, },
serializer::MapResult, serializer::MapResult,
}; };
@ -134,6 +134,18 @@ impl RustyPipeQuery {
) )
.await .await
} }
/// Get a list of YouTube playlists the current user added to their library
pub async fn saved_playlists(&self) -> Result<Paginator<PlaylistItem>, Error> {
self.clone()
.authenticated()
.continuation(
"4qmFsgJFEhZGRXBsYXlsaXN0X2FnZ3JlZ2F0aW9uGgRxQUlDmgIkNjc5MjVhZTYtMDAwMC0yYzQyLWFjMjItM2MyODZkNDI1MTQy",
ContinuationEndpoint::Browse,
None,
)
.await
}
} }
impl MapResponse<Paginator<HistoryItem<VideoItem>>> for response::History { impl MapResponse<Paginator<HistoryItem<VideoItem>>> for response::History {