diff --git a/src/providers/pornhat.rs b/src/providers/pornhat.rs index 07da770..bbee4b1 100644 --- a/src/providers/pornhat.rs +++ b/src/providers/pornhat.rs @@ -193,7 +193,7 @@ impl PornhatProvider { return vec![]; } let mut items: Vec = Vec::new(); - let raw_videos = html + let raw_videos = html.split("
>()[0] .split("
>()[1..] .to_vec(); @@ -233,26 +233,33 @@ impl PornhatProvider { if video_segment.contains("href=\"/sites/"){ let raw_tags = video_segment.split("href=\"/sites/").collect::>()[1..] .iter() - .map(|s| s.split("\"").collect::>()[0].to_string()) + .map(|s| s.split("/\"").collect::>()[0].to_string()) .collect::>(); for tag in raw_tags { if !tag.is_empty() { - tags.push(tag); + tags.push(format!("@sites:{}",tag)); } } } if video_segment.contains("href=\"/models/"){ let raw_tags = video_segment.split("href=\"/models/").collect::>()[1..] .iter() - .map(|s| s.split("\"").collect::>()[0].to_string()) + .map(|s| s.split("/\"").collect::>()[0].to_string()) .collect::>(); for tag in raw_tags { if !tag.is_empty() { - tags.push(tag); + tags.push(format!("@models:{}",tag)); } } } + let views_part = video_segment.split("fa fa-eye").collect::>()[1] + .split("").collect::>()[1] + .split("<") + .collect::>()[0] + .to_string(); + let views = parse_abbreviated_number(&views_part).unwrap_or(0) as u32; + let video_item = VideoItem::new( id, title, @@ -262,6 +269,8 @@ impl PornhatProvider { duration, ) .preview(preview_url) + .views(views) + .tags(tags) ; items.push(video_item); }