use crate::{
channel, playlist, stream, video, youtube::innertube::Api, Channel, Playlist, Stream, Video,
};
#[allow(missing_debug_implementations)]
#[derive(Clone, Default)]
pub struct Client {
pub(crate) api: Api,
}
impl Client {
pub fn new() -> Self {
Self::default()
}
pub async fn video(&self, id: video::Id) -> crate::Result<Video> {
Video::get(self.clone(), id).await
}
pub async fn streams(&self, id: video::Id) -> crate::Result<impl Iterator<Item = Stream>> {
stream::get(self.clone(), id).await
}
pub async fn playlist(&self, id: playlist::Id) -> crate::Result<Playlist> {
Playlist::get(self.clone(), id).await
}
pub async fn channel(&self, id: channel::Id) -> crate::Result<Channel> {
Channel::get(self.clone(), id).await
}
}