bugfixes
This commit is contained in:
@@ -191,18 +191,18 @@ impl HomoxxxProvider {
|
||||
return vec![];
|
||||
}
|
||||
let mut items: Vec<VideoItem> = Vec::new();
|
||||
let raw_videos = html.split("<div class=\"pagination\"").collect::<Vec<&str>>()[0]
|
||||
.split("item thumb-bl thumb-bl-video video_")
|
||||
let raw_videos = html.split("pagination").collect::<Vec<&str>>()[0]
|
||||
.split("<div class=\"item \">")
|
||||
.collect::<Vec<&str>>()[1..]
|
||||
.to_vec();
|
||||
for video_segment in &raw_videos {
|
||||
// let vid = video_segment.split("\n").collect::<Vec<&str>>();
|
||||
// for (index, line) in vid.iter().enumerate() {
|
||||
// println!("Line {}: {}", index, line);
|
||||
// }
|
||||
let video_url: String = format!("{}{}", self.url, video_segment.split("<a href=\"").collect::<Vec<&str>>()[1]
|
||||
let vid = video_segment.split("\n").collect::<Vec<&str>>();
|
||||
for (index, line) in vid.iter().enumerate() {
|
||||
println!("Line {}: {}", index, line);
|
||||
}
|
||||
let video_url: String = video_segment.split("<a href=\"").collect::<Vec<&str>>()[1]
|
||||
.split("\"")
|
||||
.collect::<Vec<&str>>()[0]);
|
||||
.collect::<Vec<&str>>()[0].to_string();
|
||||
let preview_url = video_segment.split("data-preview-custom=\"").collect::<Vec<&str>>()[1]
|
||||
.split("\"")
|
||||
.collect::<Vec<&str>>()[0]
|
||||
@@ -214,61 +214,27 @@ impl HomoxxxProvider {
|
||||
// html decode
|
||||
title = decode(title.as_bytes()).to_string().unwrap_or(title);
|
||||
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]
|
||||
.split("<span>").collect::<Vec<&str>>()[1]
|
||||
let raw_duration = video_segment
|
||||
.split("<p class=\"duration_item\">").collect::<Vec<&str>>()[1]
|
||||
.split("<")
|
||||
.collect::<Vec<&str>>()[0]
|
||||
.to_string();
|
||||
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]
|
||||
.split("data-original=\"").collect::<Vec<&str>>()[1]
|
||||
let thumb = video_segment.split("thumb lazyload").collect::<Vec<&str>>()[1]
|
||||
.split("data-src=\"").collect::<Vec<&str>>()[1]
|
||||
.split("\"")
|
||||
.collect::<Vec<&str>>()[0]
|
||||
.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(
|
||||
id,
|
||||
title,
|
||||
video_url.to_string(),
|
||||
"Perfectgirls".to_string(),
|
||||
"homoxxx".to_string(),
|
||||
thumb,
|
||||
duration,
|
||||
)
|
||||
.preview(preview_url)
|
||||
.views(views)
|
||||
.tags(tags)
|
||||
;
|
||||
items.push(video_item);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ impl OkxxxProvider {
|
||||
id,
|
||||
title,
|
||||
video_url.to_string(),
|
||||
"Perfectgirls".to_string(),
|
||||
"okxxx".to_string(),
|
||||
thumb,
|
||||
duration,
|
||||
)
|
||||
|
||||
@@ -264,7 +264,7 @@ impl PerfectgirlsProvider {
|
||||
id,
|
||||
title,
|
||||
video_url.to_string(),
|
||||
"Perfectgirls".to_string(),
|
||||
"perfectgirls".to_string(),
|
||||
thumb,
|
||||
duration,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user