clean cache, handled warnings etc
This commit is contained in:
@@ -3,7 +3,7 @@ use std::collections::HashMap;
|
||||
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug)]
|
||||
pub struct Videos_Request {
|
||||
pub struct VideosRequest {
|
||||
//"versionInstallDate":"2025-06-03T18:20:20Z","languageCode":"en","appInstallDate":"2025-06-03T18:20:20Z","server":"spacemoehre","sexu
|
||||
pub clientHash: Option<String>, // "a07b23c9b07813c65050e2a4041ca777",
|
||||
pub blockedKeywords: Option<String>, // "kittens",
|
||||
@@ -35,20 +35,20 @@ pub struct PageInfo {
|
||||
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct Video_Embed{
|
||||
pub struct VideoEmbed{
|
||||
pub html: String,
|
||||
pub source: String,
|
||||
}
|
||||
impl Video_Embed {
|
||||
impl VideoEmbed {
|
||||
pub fn new(html: String, source: String) -> Self {
|
||||
Video_Embed {
|
||||
VideoEmbed {
|
||||
html,
|
||||
source,
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct Video_Item {
|
||||
pub struct VideoItem {
|
||||
pub duration: u32, // 110,
|
||||
pub views: Option<u32>, // 14622653,
|
||||
pub rating: Option<f32>, // 0.0,
|
||||
@@ -62,10 +62,11 @@ pub struct Video_Item {
|
||||
pub verified: Option<bool>, // false,
|
||||
pub tags: Option<Vec<String>>, // [],
|
||||
pub uploadedAt: Option<u64>, // 1741142954
|
||||
pub formats: Option<Vec<Video_Format>>, // Additional HTTP headers if needed
|
||||
pub embed: Option<Video_Embed>, // Optional embed information
|
||||
pub formats: Option<Vec<VideoFormat>>, // Additional HTTP headers if needed
|
||||
pub embed: Option<VideoEmbed>, // Optional embed information
|
||||
}
|
||||
impl Video_Item {
|
||||
#[allow(dead_code)]
|
||||
impl VideoItem {
|
||||
pub fn new(
|
||||
id: String,
|
||||
title: String,
|
||||
@@ -74,7 +75,7 @@ impl Video_Item {
|
||||
thumb: String,
|
||||
duration: u32,
|
||||
) -> Self {
|
||||
Video_Item {
|
||||
VideoItem {
|
||||
duration: duration, // Placeholder, adjust as needed
|
||||
views: None, // Placeholder, adjust as needed
|
||||
rating: None, // Placeholder, adjust as needed
|
||||
@@ -120,18 +121,18 @@ impl Video_Item {
|
||||
self.uploadedAt = Some(uploaded_at);
|
||||
self
|
||||
}
|
||||
pub fn formats(mut self, formats: Vec<Video_Format>) -> Self {
|
||||
pub fn formats(mut self, formats: Vec<VideoFormat>) -> Self {
|
||||
self.formats = Some(formats);
|
||||
self
|
||||
}
|
||||
pub fn embed(mut self, embed: Video_Embed) -> Self {
|
||||
pub fn embed(mut self, embed: VideoEmbed) -> Self {
|
||||
self.embed = Some(embed);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct Video_Format {
|
||||
pub struct VideoFormat {
|
||||
url: String,
|
||||
quality: String,
|
||||
format: String,
|
||||
@@ -159,9 +160,10 @@ pub struct Video_Format {
|
||||
http_headers: Option<HashMap<String, String>>,
|
||||
|
||||
}
|
||||
impl Video_Format {
|
||||
impl VideoFormat {
|
||||
pub fn new(url: String, quality: String, format: String) -> Self {
|
||||
Video_Format {
|
||||
let _ = format;
|
||||
VideoFormat {
|
||||
url,
|
||||
quality,
|
||||
format: "mp4".to_string(), // Default format
|
||||
@@ -201,5 +203,5 @@ impl Video_Format {
|
||||
#[derive(serde::Serialize, Debug)]
|
||||
pub struct Videos {
|
||||
pub pageInfo: PageInfo,
|
||||
pub items: Vec<Video_Item>,
|
||||
pub items: Vec<VideoItem>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user