This commit is contained in:
Simon
2025-06-03 19:26:26 +00:00
parent 2ddc5e86e2
commit 8d5da3a4dc
2 changed files with 30 additions and 9 deletions

View File

@@ -146,6 +146,10 @@ impl PerverzijaProvider {
fn get_video_items_from_html(&self, html: String) -> Vec<Video_Item> {
// println!("HTML: {}", html);
if html.is_empty() {
println!("HTML is empty");
return vec![];
}
let mut items: Vec<Video_Item> = Vec::new();
let video_listing_content = html.split("video-listing-content").collect::<Vec<&str>>()[1];
let raw_videos = video_listing_content
@@ -172,7 +176,7 @@ impl PerverzijaProvider {
let url = vid[1].split("iframe src=&quot;").collect::<Vec<&str>>()[1]
.split("&quot;")
.collect::<Vec<&str>>()[0]
.to_string();
.to_string().replace("index.php", "xs1.php");
let id = url.split("data=").collect::<Vec<&str>>()[1]
.split("&")
.collect::<Vec<&str>>()[0]
@@ -205,10 +209,11 @@ impl PerverzijaProvider {
.split("'")
.collect::<Vec<&str>>()[0]
.to_string();
let referer_url = vid[1].split("data-url='").collect::<Vec<&str>>()[1]
.split("'")
.collect::<Vec<&str>>()[0]
.to_string();
// let referer_url = vid[1].split("data-url='").collect::<Vec<&str>>()[1]
// .split("'")
// .collect::<Vec<&str>>()[0]
// .to_string();
let referer_url = "https://xtremestream.xyz/".to_string();
let embed = Video_Embed::new(embed_html, url.clone());
let mut tags: Vec<String> = 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());