From 8d5da3a4dcb6dcbbbc8aec0421c3e5429c423619 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 3 Jun 2025 19:26:26 +0000 Subject: [PATCH] hotfix --- src/providers/perverzija.rs | 23 ++++++++++++++--------- src/videos.rs | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/providers/perverzija.rs b/src/providers/perverzija.rs index d1cde64..1a6b689 100644 --- a/src/providers/perverzija.rs +++ b/src/providers/perverzija.rs @@ -146,6 +146,10 @@ impl PerverzijaProvider { fn get_video_items_from_html(&self, html: String) -> Vec { // println!("HTML: {}", html); + if html.is_empty() { + println!("HTML is empty"); + return vec![]; + } let mut items: Vec = Vec::new(); let video_listing_content = html.split("video-listing-content").collect::>()[1]; let raw_videos = video_listing_content @@ -172,7 +176,7 @@ impl PerverzijaProvider { let url = vid[1].split("iframe src="").collect::>()[1] .split(""") .collect::>()[0] - .to_string(); + .to_string().replace("index.php", "xs1.php"); let id = url.split("data=").collect::>()[1] .split("&") .collect::>()[0] @@ -205,10 +209,11 @@ impl PerverzijaProvider { .split("'") .collect::>()[0] .to_string(); - let referer_url = vid[1].split("data-url='").collect::>()[1] - .split("'") - .collect::>()[0] - .to_string(); + // let referer_url = vid[1].split("data-url='").collect::>()[1] + // .split("'") + // .collect::>()[0] + // .to_string(); + let referer_url = "https://xtremestream.xyz/".to_string(); let embed = Video_Embed::new(embed_html, url.clone()); let mut tags: Vec = Vec::new(); // Placeholder for tags, adjust as needed @@ -228,8 +233,8 @@ impl PerverzijaProvider { "perverzija".to_string(), thumb, duration, - ).tags(tags) - .embed(embed.clone()); + ).tags(tags); + // .embed(embed.clone()); let mut format = videos::Video_Format::new(url.clone(), "1080".to_string(), "m3u8".to_string()); format.add_http_header("Referer".to_string(), referer_url.clone()); @@ -328,8 +333,8 @@ impl PerverzijaProvider { thumb, duration, ) - .tags(tags) - .embed(embed.clone()); + .tags(tags); + // .embed(embed.clone()); let mut format = videos::Video_Format::new(url.clone(), "1080".to_string(), "m3u8".to_string()); format.add_http_header("Referer".to_string(), referer_url.clone()); diff --git a/src/videos.rs b/src/videos.rs index c420271..d3dc66e 100644 --- a/src/videos.rs +++ b/src/videos.rs @@ -1,7 +1,23 @@ use std::collections::HashMap; + + #[derive(serde::Serialize, serde::Deserialize, Debug)] pub struct Videos_Request { + //"versionInstallDate":"2025-06-03T18:20:20Z","languageCode":"en","appInstallDate":"2025-06-03T18:20:20Z","server":"spacemoehre","sexu + pub clientHash: String, // "a07b23c9b07813c65050e2a4041ca777", + pub blockedKeywords: Option, // "kittens", + pub countryCode: Option, // "DE", + pub clientVersion: Option, // "2.1.4-22b", + pub timestamp: Option, // "1748976686", + pub blockedUploaders: Option, // "", + pub anonId: Option, // "1AB8A060-A47D-47EF-B9CB-63980ED84C8A", + pub debugTools: Option, // false, + pub versionInstallDate: Option, // "2025-06-03T18:20:20Z", + pub languageCode: Option, // "en", + pub appInstallDate: Option, // "2025-06-03T18:20:20Z", + pub server: Option, // "spacemoehre", + pub sexuality: Option, // "straight", pub channel: Option, //"youtube", pub sort: Option, //"new", pub query: Option, //"kittens",