This commit is contained in:
Simon
2025-08-15 18:56:19 +00:00
parent 8add6f44aa
commit 7185d89a64
3 changed files with 15 additions and 49 deletions

View File

@@ -191,18 +191,18 @@ impl HomoxxxProvider {
return vec![]; return vec![];
} }
let mut items: Vec<VideoItem> = Vec::new(); let mut items: Vec<VideoItem> = Vec::new();
let raw_videos = html.split("<div class=\"pagination\"").collect::<Vec<&str>>()[0] let raw_videos = html.split("pagination").collect::<Vec<&str>>()[0]
.split("item thumb-bl thumb-bl-video video_") .split("<div class=\"item \">")
.collect::<Vec<&str>>()[1..] .collect::<Vec<&str>>()[1..]
.to_vec(); .to_vec();
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() {
// println!("Line {}: {}", index, line); println!("Line {}: {}", index, line);
// } }
let video_url: String = format!("{}{}", self.url, video_segment.split("<a href=\"").collect::<Vec<&str>>()[1] let video_url: String = video_segment.split("<a href=\"").collect::<Vec<&str>>()[1]
.split("\"") .split("\"")
.collect::<Vec<&str>>()[0]); .collect::<Vec<&str>>()[0].to_string();
let preview_url = video_segment.split("data-preview-custom=\"").collect::<Vec<&str>>()[1] let preview_url = video_segment.split("data-preview-custom=\"").collect::<Vec<&str>>()[1]
.split("\"") .split("\"")
.collect::<Vec<&str>>()[0] .collect::<Vec<&str>>()[0]
@@ -214,61 +214,27 @@ impl HomoxxxProvider {
// html decode // html decode
title = decode(title.as_bytes()).to_string().unwrap_or(title); title = decode(title.as_bytes()).to_string().unwrap_or(title);
let id = video_url.split("/").collect::<Vec<&str>>()[4].to_string(); let id = video_url.split("/").collect::<Vec<&str>>()[4].to_string();
let raw_duration = video_segment.split("fa fa-clock-o").collect::<Vec<&str>>()[1] let raw_duration = video_segment
.split("<span>").collect::<Vec<&str>>()[1] .split("<p class=\"duration_item\">").collect::<Vec<&str>>()[1]
.split("<") .split("<")
.collect::<Vec<&str>>()[0] .collect::<Vec<&str>>()[0]
.to_string(); .to_string();
let duration = parse_time_to_seconds(&raw_duration).unwrap_or(0) as u32; let duration = parse_time_to_seconds(&raw_duration).unwrap_or(0) as u32;
let thumb = video_segment.split(" class=\"thumb lazy-load\"").collect::<Vec<&str>>()[1] let thumb = video_segment.split("thumb lazyload").collect::<Vec<&str>>()[1]
.split("data-original=\"").collect::<Vec<&str>>()[1] .split("data-src=\"").collect::<Vec<&str>>()[1]
.split("\"") .split("\"")
.collect::<Vec<&str>>()[0] .collect::<Vec<&str>>()[0]
.to_string(); .to_string();
let mut tags = vec![];
if video_segment.contains("href=\"/sites/"){
let raw_tags = video_segment.split("href=\"/sites/").collect::<Vec<&str>>()[1..]
.iter()
.map(|s| s.split("/\"").collect::<Vec<&str>>()[0].to_string())
.collect::<Vec<String>>();
for tag in raw_tags {
if !tag.is_empty() {
tags.push(format!("@sites:{}",tag));
}
}
}
if video_segment.contains("href=\"/models/"){
let raw_tags = video_segment.split("href=\"/models/").collect::<Vec<&str>>()[1..]
.iter()
.map(|s| s.split("/\"").collect::<Vec<&str>>()[0].to_string())
.collect::<Vec<String>>();
for tag in raw_tags {
if !tag.is_empty() {
tags.push(format!("@models:{}",tag));
}
}
}
let views_part = video_segment.split("fa fa-eye").collect::<Vec<&str>>()[1]
.split("<span>").collect::<Vec<&str>>()[1]
.split("<")
.collect::<Vec<&str>>()[0]
.to_string();
let views = parse_abbreviated_number(&views_part).unwrap_or(0) as u32;
let video_item = VideoItem::new( let video_item = VideoItem::new(
id, id,
title, title,
video_url.to_string(), video_url.to_string(),
"Perfectgirls".to_string(), "homoxxx".to_string(),
thumb, thumb,
duration, duration,
) )
.preview(preview_url) .preview(preview_url)
.views(views)
.tags(tags)
; ;
items.push(video_item); items.push(video_item);
} }

View File

@@ -262,7 +262,7 @@ impl OkxxxProvider {
id, id,
title, title,
video_url.to_string(), video_url.to_string(),
"Perfectgirls".to_string(), "okxxx".to_string(),
thumb, thumb,
duration, duration,
) )

View File

@@ -264,7 +264,7 @@ impl PerfectgirlsProvider {
id, id,
title, title,
video_url.to_string(), video_url.to_string(),
"Perfectgirls".to_string(), "perfectgirls".to_string(),
thumb, thumb,
duration, duration,
) )