cleanup and fixing
This commit is contained in:
111
src/api.rs
111
src/api.rs
@@ -5,7 +5,6 @@ use ntex::web::HttpRequest;
|
||||
use crate::providers::perverzija::PerverzijaProvider;
|
||||
use crate::{providers::*, status::*, videos::*};
|
||||
|
||||
// this function could be located in a different module
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
web::resource("/status")
|
||||
@@ -165,17 +164,6 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
||||
async fn videos_post(
|
||||
video_request: web::types::Json<Videos_Request>,
|
||||
) -> Result<impl web::Responder, web::Error> {
|
||||
// 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 mut videos = Videos {
|
||||
pageInfo: PageInfo {
|
||||
hasNextPage: true,
|
||||
@@ -213,102 +201,5 @@ async fn videos_post(
|
||||
.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);
|
||||
// ####
|
||||
|
||||
|
||||
Ok(web::HttpResponse::Ok().json(&videos))
|
||||
}
|
||||
|
||||
// async fn videos_get(_req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
||||
// let mut http_headers: HashMap<String, String> = HashMap::new();
|
||||
// // http_headers.insert(
|
||||
// // "Referer".to_string(),
|
||||
// // "https://pervl2.xtremestream.xyz/player/index.php?data=794a51bb65913debd98f73111705738a"
|
||||
// // .to_string(),
|
||||
// // );
|
||||
// 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/player/index.php?data=794a51bb65913debd98f73111705738a"
|
||||
// .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
|
||||
|
||||
// }
|
||||
// ],
|
||||
// };
|
||||
|
||||
// println!("Video: {:?}", videos);
|
||||
// Ok(web::HttpResponse::Ok().json(&videos))
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user