feat: add channel video/playlist continuation

This commit is contained in:
ThetaDev 2022-09-26 21:26:22 +02:00
parent 6f1a1c4440
commit 6ac5bc3782
14 changed files with 19775 additions and 29 deletions

View file

@ -11,7 +11,9 @@ use crate::{
util::{self, TryRemove},
};
use super::{response, ClientType, MapResponse, MapResult, RustyPipeQuery, YTContext};
use super::{
response, ClientType, MapResponse, MapResult, QContinuation, RustyPipeQuery, YTContext,
};
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
@ -20,13 +22,6 @@ struct QPlaylist {
browse_id: String,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct QPlaylistCont {
context: YTContext,
continuation: String,
}
impl RustyPipeQuery {
pub async fn playlist(self, playlist_id: &str) -> Result<Playlist> {
let context = self.get_context(ClientType::Desktop, true).await;
@ -48,7 +43,7 @@ impl RustyPipeQuery {
pub async fn playlist_continuation(self, ctoken: &str) -> Result<Paginator<PlaylistVideo>> {
let context = self.get_context(ClientType::Desktop, true).await;
let request_body = QPlaylistCont {
let request_body = QContinuation {
context,
continuation: ctoken.to_owned(),
};