This commit is contained in:
Simon
2025-07-19 14:43:57 +00:00
parent 41374470b1
commit 8a477bffc9

View File

@@ -114,7 +114,7 @@ impl PornhubProvider {
let url_parts = query[1..].split(":").collect::<Vec<&str>>(); let url_parts = query[1..].split(":").collect::<Vec<&str>>();
url = [self.url.to_string(), url_parts[0].to_string(), url_parts[1].to_string(), "videos?page=".to_string()].join("/"); url = [self.url.to_string(), url_parts[0].to_string(), url_parts[1].to_string(), "videos?page=".to_string()].join("/");
url += &page.to_string(); url += &page.to_string();
if query.contains("@model"){ if query.contains("@model") || query.contains("@pornstar"){
split_string = "mostRecentVideosSection"; split_string = "mostRecentVideosSection";
} }
if query.contains("@channels"){ if query.contains("@channels"){
@@ -185,14 +185,11 @@ impl PornhubProvider {
return vec![]; return vec![];
} }
let mut items: Vec<VideoItem> = Vec::new(); let mut items: Vec<VideoItem> = Vec::new();
println!("split_string: {}", split_string);
let video_listing_content = html.split(split_string).collect::<Vec<&str>>()[1].split("Porn in German").collect::<Vec<&str>>()[0]; let video_listing_content = html.split(split_string).collect::<Vec<&str>>()[1].split("Porn in German").collect::<Vec<&str>>()[0];
println!("Video listing content length: {}", video_listing_content.len());
let raw_videos = video_listing_content let raw_videos = video_listing_content
.split("class=\"pcVideoListItem ") .split("class=\"pcVideoListItem ")
.collect::<Vec<&str>>()[1..] .collect::<Vec<&str>>()[1..]
.to_vec(); .to_vec();
println!("Number of video segments found: {}", raw_videos.len());
for video_segment in &raw_videos { for video_segment in &raw_videos {
// let vid = video_segment.split("\n").collect::<Vec<&str>>(); // let vid = video_segment.split("\n").collect::<Vec<&str>>();
// for (index, line) in vid.iter().enumerate() { // for (index, line) in vid.iter().enumerate() {