omgxxx bugfixes

This commit is contained in:
Simon
2025-10-04 09:39:40 +00:00
parent 5b2a7430bc
commit d84cc715a8

View File

@@ -153,14 +153,15 @@ impl OmgxxxProvider {
} }
let mut items: Vec<VideoItem> = Vec::new(); let mut items: Vec<VideoItem> = Vec::new();
let raw_videos = html.split("videos_list_pagination").collect::<Vec<&str>>()[0] let raw_videos = html.split("videos_list_pagination").collect::<Vec<&str>>()[0]
.split(" class=\"pagination\" ").collect::<Vec<&str>>()[0]
.split("class=\"list-videos\"").collect::<Vec<&str>>()[1] .split("class=\"list-videos\"").collect::<Vec<&str>>()[1]
.split("class=\"item\"").collect::<Vec<&str>>()[1..] .split("class=\"item\"").collect::<Vec<&str>>()[1..]
.to_vec(); .to_vec();
for video_segment in &raw_videos { for video_segment in &raw_videos {
// let vid = video_segment.split("\n").collect::<Vec<&str>>(); let vid = video_segment.split("\n").collect::<Vec<&str>>();
// for (index, line) in vid.iter().enumerate() { for (index, line) in vid.iter().enumerate() {
// println!("Line {}: {}", index, line); println!("Line {}: {}", index, line);
// } }
let video_url: String = video_segment.split("<a href=\"").collect::<Vec<&str>>()[1] let video_url: String = video_segment.split("<a href=\"").collect::<Vec<&str>>()[1]
.split("\"") .split("\"")
.collect::<Vec<&str>>()[0].to_string(); .collect::<Vec<&str>>()[0].to_string();
@@ -193,13 +194,16 @@ impl OmgxxxProvider {
.split("\"").collect::<Vec<&str>>()[0] .split("\"").collect::<Vec<&str>>()[0]
.to_string(); .to_string();
let tags = video_segment.split("class=\"models\">").collect::<Vec<&str>>()[1] let tags = match video_segment.contains("class=\"models\">"){
true => video_segment.split("class=\"models\">").collect::<Vec<&str>>()[1]
.split("</div>").collect::<Vec<&str>>()[0] .split("</div>").collect::<Vec<&str>>()[0]
.split("href=\"").collect::<Vec<&str>>()[1..] .split("href=\"").collect::<Vec<&str>>()[1..]
.into_iter().map( .into_iter().map(
|s| format!("@models:{}", s.split("/").collect::<Vec<&str>>()[4] |s| format!("@models:{}", s.split("/").collect::<Vec<&str>>()[4]
.to_string()) .to_string())
).collect::<Vec<String>>().to_vec() ).collect::<Vec<String>>().to_vec(),
false => vec![]
}
; ;
let video_item = VideoItem::new( let video_item = VideoItem::new(