fixes and cleanup

This commit is contained in:
Simon
2026-03-05 18:18:48 +00:00
parent 76fd5a4f4f
commit 2627505ade
49 changed files with 3245 additions and 1376 deletions

View File

@@ -120,17 +120,40 @@ impl FreepornvideosxxxProvider {
.copied()
.unwrap_or_default()
.split("custom_list_models_models_list_pagination")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default();
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default();
for stars_element in stars_div.split("<a ").collect::<Vec<&str>>()[1..].to_vec() {
let star_url = stars_element.split("href=\"").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
let star_url = stars_element
.split("href=\"")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default();
let star_id = star_url.split("/").collect::<Vec<&str>>().get(4).copied().unwrap_or_default().to_string();
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default();
let star_id = star_url
.split("/")
.collect::<Vec<&str>>()
.get(4)
.copied()
.unwrap_or_default()
.to_string();
let star_name = stars_element
.split("<strong class=\"title\">")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("<")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string();
Self::push_unique(
&stars,
@@ -168,19 +191,47 @@ impl FreepornvideosxxxProvider {
}
let sites_div = text
.split("id=\"list_content_sources_sponsors_list_items\"")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("class=\"pagination\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default();
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default();
for sites_element in
sites_div.split("class=\"headline\"").collect::<Vec<&str>>()[1..].to_vec()
{
let site_url = sites_element.split("href=\"").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
let site_url = sites_element
.split("href=\"")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default();
let site_id = site_url.split("/").collect::<Vec<&str>>().get(4).copied().unwrap_or_default().to_string();
let site_name = sites_element.split("<h2>").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default();
let site_id = site_url
.split("/")
.collect::<Vec<&str>>()
.get(4)
.copied()
.unwrap_or_default()
.to_string();
let site_name = sites_element
.split("<h2>")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("<")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string();
Self::push_unique(
&sites,
@@ -207,22 +258,52 @@ impl FreepornvideosxxxProvider {
return Ok(());
}
};
let networks_div = text.split("class=\"sites__list\"").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
let networks_div = text
.split("class=\"sites__list\"")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("</div>")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default();
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default();
for network_element in
networks_div.split("sites__item").collect::<Vec<&str>>()[1..].to_vec()
{
if network_element.contains("sites__all") {
continue;
}
let network_url = network_element.split("href=\"").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
let network_url = network_element
.split("href=\"")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default();
let network_id = network_url.split("/").collect::<Vec<&str>>().get(4).copied().unwrap_or_default().to_string();
let network_name = network_element.split(">").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default();
let network_id = network_url
.split("/")
.collect::<Vec<&str>>()
.get(4)
.copied()
.unwrap_or_default()
.to_string();
let network_name = network_element
.split(">")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("<")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string();
Self::push_unique(
&networks,
@@ -271,7 +352,8 @@ impl FreepornvideosxxxProvider {
name: "FreePornVideos XXX".to_string(),
description: "Free Porn Videos".to_string(),
premium: false,
favicon: "https://www.google.com/s2/favicons?sz=64&domain=www.freepornvideos.xxx".to_string(),
favicon: "https://www.google.com/s2/favicons?sz=64&domain=www.freepornvideos.xxx"
.to_string(),
status: "active".to_string(),
categories: vec![],
options: vec![
@@ -522,11 +604,22 @@ impl FreepornvideosxxxProvider {
if !html.contains("class=\"item\"") {
return items;
}
let raw_videos = html.split("videos_list_pagination").collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
let raw_videos = html
.split("videos_list_pagination")
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.split(" class=\"pagination\" ")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.split("class=\"list-videos\"")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("class=\"item\"")
.collect::<Vec<&str>>()[1..]
.to_vec();
@@ -535,39 +628,94 @@ impl FreepornvideosxxxProvider {
// for (index, line) in vid.iter().enumerate() {
// println!("Line {}: {}", index, line);
// }
let video_url: String = video_segment.split("<a href=\"").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
let video_url: String = video_segment
.split("<a href=\"")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string();
let mut title = video_segment.split(" title=\"").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
let mut title = video_segment
.split(" title=\"")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string();
// html decode
title = decode(title.as_bytes()).to_string().unwrap_or(title);
let id = video_url.split("/").collect::<Vec<&str>>().get(4).copied().unwrap_or_default().to_string();
let id = video_url
.split("/")
.collect::<Vec<&str>>()
.get(4)
.copied()
.unwrap_or_default()
.to_string();
let thumb = match video_segment.split("<img ").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
let thumb = match video_segment
.split("<img ")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.contains("data-src=\"")
{
true => video_segment.split("<img ").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
true => video_segment
.split("<img ")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("data-src=\"")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string(),
false => video_segment.split("<img ").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
false => video_segment
.split("<img ")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("src=\"")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string(),
};
let raw_duration = video_segment
.split("<span class=\"duration\">")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("<")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.split(" ")
.collect::<Vec<&str>>()
.last()
@@ -577,9 +725,15 @@ impl FreepornvideosxxxProvider {
let views = parse_abbreviated_number(
video_segment
.split("<div class=\"views\">")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("<")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string()
.as_str(),
)
@@ -587,9 +741,15 @@ impl FreepornvideosxxxProvider {
let preview = video_segment
.split("data-preview=\"")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("\"")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.to_string();
let site_name = title
.split("]")
@@ -603,9 +763,15 @@ impl FreepornvideosxxxProvider {
let mut tags = match video_segment.contains("class=\"models\">") {
true => video_segment
.split("class=\"models\">")
.collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("</div>")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.split("href=\"")
.collect::<Vec<&str>>()[1..]
.into_iter()
@@ -613,17 +779,38 @@ impl FreepornvideosxxxProvider {
Self::push_unique(
&self.stars,
FilterOption {
id: s.split("/").collect::<Vec<&str>>().get(4).copied().unwrap_or_default().to_string(),
title: s.split(">").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
id: s
.split("/")
.collect::<Vec<&str>>()
.get(4)
.copied()
.unwrap_or_default()
.to_string(),
title: s
.split(">")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("<")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.trim()
.to_string(),
},
);
s.split(">").collect::<Vec<&str>>().get(1).copied().unwrap_or_default()
s.split(">")
.collect::<Vec<&str>>()
.get(1)
.copied()
.unwrap_or_default()
.split("<")
.collect::<Vec<&str>>().get(0).copied().unwrap_or_default()
.collect::<Vec<&str>>()
.get(0)
.copied()
.unwrap_or_default()
.trim()
.to_string()
})