diff --git a/src/providers/sxyprn.rs b/src/providers/sxyprn.rs index b6f4c23..471cc2f 100644 --- a/src/providers/sxyprn.rs +++ b/src/providers/sxyprn.rs @@ -12,6 +12,7 @@ use crate::providers::Provider; use crate::util::cache::VideoCache; use crate::util::flaresolverr::{FlareSolverrRequest, Flaresolverr}; use crate::util::requester; +use crate::util::time::parse_time_to_seconds; use crate::videos::ServerOptions; use crate::videos::{VideoItem}; use crate::DbPool; @@ -155,7 +156,6 @@ impl SxyprnProvider { .split("") .collect::>()[0] ; - println!("Title parts: {}", title_parts); let document = Html::parse_document(title_parts); let selector = Selector::parse("*").unwrap(); @@ -166,9 +166,6 @@ impl SxyprnProvider { texts.push(text.trim().to_string()); } } - - println!("Texts: {:?}", texts); - let mut title = texts[0].clone(); // html decode title = decode(title.as_bytes()).to_string().unwrap_or(title).replace(" "," "); @@ -195,13 +192,20 @@ impl SxyprnProvider { .collect::>()[0] .to_string(); + let raw_duration = video_segment + .split("duration_small").collect::>()[1] + .split(">").collect::>()[1] + .split("<").collect::>()[0] + .to_string(); + let duration = parse_time_to_seconds(&raw_duration).unwrap_or(0) as u32; + let video_item = VideoItem::new( id, title, video_url.to_string(), "sxyprn".to_string(), thumb, - 0, + duration, ) .preview(preview) .views(views.parse::().unwrap_or(0))