supervisor and other update
This commit is contained in:
152
src/api.rs
152
src/api.rs
@@ -176,87 +176,89 @@ async fn videos_post(
|
||||
// "https://pervl2.xtremestream.xyz"
|
||||
// .to_string(),
|
||||
// );
|
||||
// let mut videos = Videos {
|
||||
// pageInfo: PageInfo {
|
||||
// hasNextPage: true,
|
||||
// resultsPerPage: 10,
|
||||
// },
|
||||
// items: vec![],
|
||||
// };
|
||||
// let channel: String = video_request
|
||||
// .channel
|
||||
// .as_deref()
|
||||
// .unwrap_or("all")
|
||||
// .to_string();
|
||||
// let sort: String = video_request.sort.as_deref().unwrap_or("date").to_string();
|
||||
// let mut query: Option<String> = video_request.query.clone();
|
||||
// if video_request.query.as_deref() == Some("") {
|
||||
// query = None;
|
||||
// }
|
||||
// let page: u8 = video_request
|
||||
// .page
|
||||
// .as_deref()
|
||||
// .unwrap_or("1")
|
||||
// .to_string()
|
||||
// .parse()
|
||||
// .unwrap();
|
||||
// let perPage: u8 = video_request
|
||||
// .perPage
|
||||
// .as_deref()
|
||||
// .unwrap_or("10")
|
||||
// .to_string()
|
||||
// .parse()
|
||||
// .unwrap();
|
||||
// let featured = video_request.featured.as_deref().unwrap_or("all").to_string();
|
||||
// let provider = PerverzijaProvider::new();
|
||||
// let video_items = provider
|
||||
// .get_videos(channel, sort, query, page.to_string(), perPage.to_string(), featured)
|
||||
// .await;
|
||||
// videos.items = video_items.clone();
|
||||
|
||||
/// #### MOCK RESPONSE
|
||||
///
|
||||
let mut format = Video_Format::new(
|
||||
"https://pervl2.xtremestream.xyz/player/xs1.php?data=794a51bb65913debd98f73111705738a"
|
||||
.to_string(),
|
||||
"1080p".to_string(),
|
||||
"m3u8".to_string(),
|
||||
);
|
||||
format.add_http_header(
|
||||
"Referer".to_string(),
|
||||
"https://pervl2.xtremestream.xyz"
|
||||
.to_string(),
|
||||
);
|
||||
let videos = Videos {
|
||||
let mut videos = Videos {
|
||||
pageInfo: PageInfo {
|
||||
hasNextPage: true,
|
||||
resultsPerPage: 10,
|
||||
},
|
||||
items: vec![
|
||||
Video_Item{
|
||||
duration: 110, // 110,
|
||||
views: Some(14622653), // 14622653,
|
||||
rating: Some(0.0), // 0.0,
|
||||
id: "794a51bb65913debd98f73111705738a".to_string(), // "c85017ca87477168d648727753c4ded8a35f173e22ef93743e707b296becb299",
|
||||
title: "BrazzersExxtra – Give Me A D! The Best Of Cheerleaders".to_string(), // "20 Minutes of Adorable Kittens BEST Compilation",
|
||||
// url: "https://tube.perverzija.com/brazzersexxtra-give-me-a-d-the-best-of-cheerleaders/".to_string(),
|
||||
// url : "https://pervl2.xtremestream.xyz/player/xs1.php?data=794a51bb65913debd98f73111705738a".to_string(), // "https://www.youtube.com/watch?v=y0sF5xhGreA",
|
||||
url : "https://pervl2.xtremestream.xyz/player/index.php?data=794a51bb65913debd98f73111705738a".to_string(),
|
||||
channel: "perverzija".to_string(), // "youtube",
|
||||
thumb: "https://tube.perverzija.com/wp-content/uploads/2025/05/BrazzersExxtra-Give-Me-A-D-The-Best-Of-Cheerleaders.jpg".to_string(), // "https://i.ytimg.com/vi/y0sF5xhGreA/hqdefault.jpg",
|
||||
uploader: Some("Brazzers".to_string()), // "The Pet Collective",
|
||||
uploaderUrl: Some("https://brazzers.com".to_string()), // "https://www.youtube.com/@petcollective",
|
||||
verified: Some(false), // false,
|
||||
tags: Some(vec![]), // [],
|
||||
uploadedAt: Some(1741142954), // 1741142954
|
||||
formats: Some(vec![format]), // Additional HTTP headers if needed
|
||||
embed: None,
|
||||
|
||||
}
|
||||
],
|
||||
items: vec![],
|
||||
};
|
||||
let channel: String = video_request
|
||||
.channel
|
||||
.as_deref()
|
||||
.unwrap_or("all")
|
||||
.to_string();
|
||||
let sort: String = video_request.sort.as_deref().unwrap_or("date").to_string();
|
||||
let mut query: Option<String> = video_request.query.clone();
|
||||
if video_request.query.as_deref() == Some("") {
|
||||
query = None;
|
||||
}
|
||||
let page: u8 = video_request
|
||||
.page
|
||||
.as_deref()
|
||||
.unwrap_or("1")
|
||||
.to_string()
|
||||
.parse()
|
||||
.unwrap();
|
||||
let perPage: u8 = video_request
|
||||
.perPage
|
||||
.as_deref()
|
||||
.unwrap_or("10")
|
||||
.to_string()
|
||||
.parse()
|
||||
.unwrap();
|
||||
let featured = video_request.featured.as_deref().unwrap_or("all").to_string();
|
||||
let provider = PerverzijaProvider::new();
|
||||
let video_items = provider
|
||||
.get_videos(channel, sort, query, page.to_string(), perPage.to_string(), featured)
|
||||
.await;
|
||||
videos.items = video_items.clone();
|
||||
|
||||
/// #### MOCK RESPONSE
|
||||
///
|
||||
// let mut format = Video_Format::new(
|
||||
// "https://pervl2.xtremestream.xyz/player/xs1.php?data=794a51bb65913debd98f73111705738a"
|
||||
// .to_string(),
|
||||
// "1080p".to_string(),
|
||||
// "m3u8".to_string(),
|
||||
// );
|
||||
// format.add_http_header(
|
||||
// "Referer".to_string(),
|
||||
// "https://pervl2.xtremestream.xyz"
|
||||
// .to_string(),
|
||||
// );
|
||||
// let videos = Videos {
|
||||
// pageInfo: PageInfo {
|
||||
// hasNextPage: true,
|
||||
// resultsPerPage: 10,
|
||||
// },
|
||||
// items: vec![
|
||||
// Video_Item{
|
||||
// duration: 110, // 110,
|
||||
// views: Some(14622653), // 14622653,
|
||||
// rating: Some(0.0), // 0.0,
|
||||
// id: "794a51bb65913debd98f73111705738a".to_string(), // "c85017ca87477168d648727753c4ded8a35f173e22ef93743e707b296becb299",
|
||||
// title: "BrazzersExxtra – Give Me A D! The Best Of Cheerleaders".to_string(), // "20 Minutes of Adorable Kittens BEST Compilation",
|
||||
// // url: "https://tube.perverzija.com/brazzersexxtra-give-me-a-d-the-best-of-cheerleaders/".to_string(),
|
||||
// // url : "https://pervl2.xtremestream.xyz/player/xs1.php?data=794a51bb65913debd98f73111705738a".to_string(), // "https://www.youtube.com/watch?v=y0sF5xhGreA",
|
||||
// url : "https://pervl2.xtremestream.xyz/player/index.php?data=794a51bb65913debd98f73111705738a".to_string(),
|
||||
// channel: "perverzija".to_string(), // "youtube",
|
||||
// thumb: "https://tube.perverzija.com/wp-content/uploads/2025/05/BrazzersExxtra-Give-Me-A-D-The-Best-Of-Cheerleaders.jpg".to_string(), // "https://i.ytimg.com/vi/y0sF5xhGreA/hqdefault.jpg",
|
||||
// uploader: Some("Brazzers".to_string()), // "The Pet Collective",
|
||||
// uploaderUrl: Some("https://brazzers.com".to_string()), // "https://www.youtube.com/@petcollective",
|
||||
// verified: Some(false), // false,
|
||||
// tags: Some(vec![]), // [],
|
||||
// uploadedAt: Some(1741142954), // 1741142954
|
||||
// formats: Some(vec![format]), // Additional HTTP headers if needed
|
||||
// embed: None,
|
||||
|
||||
// }
|
||||
// ],
|
||||
// };
|
||||
|
||||
// println!("Video: {:?}", videos);
|
||||
// ####
|
||||
|
||||
println!("Video: {:?}", videos);
|
||||
|
||||
Ok(web::HttpResponse::Ok().json(&videos))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user