fixed queried thumbnails

This commit is contained in:
Simon
2025-08-09 11:26:58 +00:00
parent 4aba459f04
commit e7998f8e19
2 changed files with 8 additions and 4 deletions

View File

@@ -434,7 +434,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
status.add_channel(Channel { status.add_channel(Channel {
id: "redtube".to_string(), id: "redtube".to_string(),
name: "Redtube".to_string(), name: "Redtube".to_string(),
description: "Redtube brings you NEW porn videos every day for free. Enjoy our XXX movies in high quality HD resolution on any device. Get fully immersed with the latest virtual reality sex videos from top adult studios. Stream all of the hottest porn movies from your favorite categories, pornstars and porn channels !".to_string(), description: "Redtube brings you NEW porn videos every day for free".to_string(),
premium: false, premium: false,
favicon: "https://www.google.com/s2/favicons?sz=64&domain=www.redtube.com".to_string(), favicon: "https://www.google.com/s2/favicons?sz=64&domain=www.redtube.com".to_string(),
status: "active".to_string(), status: "active".to_string(),

View File

@@ -231,11 +231,12 @@ impl RedtubeProvider {
let id = vid.split("data-video-id=\"").collect::<Vec<&str>>()[1].split("\"").collect::<Vec<&str>>()[0].to_string(); let id = vid.split("data-video-id=\"").collect::<Vec<&str>>()[1].split("\"").collect::<Vec<&str>>()[0].to_string();
let video_url = format!("{}/{}", self.url, id); let video_url = format!("{}/{}", self.url, id);
let title = vid.split(format!("href=\"/{}\"",id).as_str()).collect::<Vec<&str>>()[1].split(">").collect::<Vec<&str>>()[1].split("<").collect::<Vec<&str>>()[0].trim().to_string(); let title = vid.split(format!("href=\"/{}\"",id).as_str()).collect::<Vec<&str>>()[1].split(">").collect::<Vec<&str>>()[1].split("<").collect::<Vec<&str>>()[0].trim().to_string();
let thumb = vid.split("<img").collect::<Vec<&str>>()[1].split(" src=\"").collect::<Vec<&str>>()[1].split("\"").collect::<Vec<&str>>()[0].to_string(); let thumb = vid.split("<img").collect::<Vec<&str>>()[1].split(" data-src=\"").collect::<Vec<&str>>()[1].split("\"").collect::<Vec<&str>>()[0].to_string();
let raw_duration = vid.split("<span class=\"video-properties tm_video_duration\">").collect::<Vec<&str>>()[1].split("</span>").collect::<Vec<&str>>()[0].trim().to_string(); let raw_duration = vid.split("<span class=\"video-properties tm_video_duration\">").collect::<Vec<&str>>()[1].split("</span>").collect::<Vec<&str>>()[0].trim().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 views_str = vid.split("<span class='info-views'>").collect::<Vec<&str>>()[1].split("</span>").collect::<Vec<&str>>()[0].trim().to_string(); let views_str = vid.split("<span class='info-views'>").collect::<Vec<&str>>()[1].split("</span>").collect::<Vec<&str>>()[0].trim().to_string();
let views = parse_abbreviated_number(&views_str).unwrap_or(0) as u32; let views = parse_abbreviated_number(&views_str).unwrap_or(0) as u32;
let preview = vid.split("<img").collect::<Vec<&str>>()[1].split(" data-mediabook=\"").collect::<Vec<&str>>()[1].split("\"").collect::<Vec<&str>>()[0].to_string();
let video_item = VideoItem::new( let video_item = VideoItem::new(
id, id,
@@ -245,8 +246,11 @@ impl RedtubeProvider {
thumb, thumb,
duration, duration,
) )
.views(views); .views(views)
.preview(preview)
;
items.push(video_item); items.push(video_item);
break;
} }
return items; return items;
} }