feat: add channel video/playlist continuation
This commit is contained in:
parent
6f1a1c4440
commit
6ac5bc3782
14 changed files with 19775 additions and 29 deletions
|
|
@ -16,7 +16,7 @@ use crate::{
|
|||
|
||||
use super::{
|
||||
response::{self, IconType, IsLive},
|
||||
ClientType, MapResponse, RustyPipeQuery, YTContext,
|
||||
ClientType, MapResponse, QContinuation, RustyPipeQuery, YTContext,
|
||||
};
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
|
|
@ -30,12 +30,6 @@ struct QVideo {
|
|||
racy_check_ok: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct QVideoCont {
|
||||
context: YTContext,
|
||||
continuation: String,
|
||||
}
|
||||
|
||||
impl RustyPipeQuery {
|
||||
pub async fn video_details(self, video_id: &str) -> Result<VideoDetails> {
|
||||
let context = self.get_context(ClientType::Desktop, true).await;
|
||||
|
|
@ -59,7 +53,7 @@ impl RustyPipeQuery {
|
|||
|
||||
pub async fn video_recommendations(self, ctoken: &str) -> Result<Paginator<RecommendedVideo>> {
|
||||
let context = self.get_context(ClientType::Desktop, true).await;
|
||||
let request_body = QVideoCont {
|
||||
let request_body = QContinuation {
|
||||
context,
|
||||
continuation: ctoken.to_owned(),
|
||||
};
|
||||
|
|
@ -77,7 +71,7 @@ impl RustyPipeQuery {
|
|||
|
||||
pub async fn video_comments(self, ctoken: &str) -> Result<Paginator<Comment>> {
|
||||
let context = self.get_context(ClientType::Desktop, true).await;
|
||||
let request_body = QVideoCont {
|
||||
let request_body = QContinuation {
|
||||
context,
|
||||
continuation: ctoken.to_owned(),
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue