omgxxx bugfix
This commit is contained in:
@@ -153,14 +153,14 @@ impl OmgxxxProvider {
|
||||
}
|
||||
let mut items: Vec<VideoItem> = Vec::new();
|
||||
let raw_videos = html.split("videos_list_pagination").collect::<Vec<&str>>()[0]
|
||||
.split("<div class=\"item\"")
|
||||
.collect::<Vec<&str>>()[1..]
|
||||
.split("class=\"list-videos\"").collect::<Vec<&str>>()[1]
|
||||
.split("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 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].to_string();
|
||||
@@ -171,10 +171,14 @@ impl OmgxxxProvider {
|
||||
title = decode(title.as_bytes()).to_string().unwrap_or(title);
|
||||
let id = video_url.split("/").collect::<Vec<&str>>()[4].to_string();
|
||||
|
||||
let thumb = video_segment.split("img loading").collect::<Vec<&str>>()[1]
|
||||
.split("data-src=\"").collect::<Vec<&str>>()[1]
|
||||
let thumb = match video_segment.split("img loading").collect::<Vec<&str>>()[1].contains("data-src=\"") {
|
||||
true => video_segment.split("img loading").collect::<Vec<&str>>()[1].split("data-src=\"").collect::<Vec<&str>>()[1]
|
||||
.split("\"").collect::<Vec<&str>>()[0]
|
||||
.to_string();
|
||||
.to_string(),
|
||||
false => video_segment.split("img loading").collect::<Vec<&str>>()[1].split("data-original=\"").collect::<Vec<&str>>()[1]
|
||||
.split("\"").collect::<Vec<&str>>()[0]
|
||||
.to_string(),
|
||||
};
|
||||
let raw_duration = video_segment.split("<span class=\"duration\">").collect::<Vec<&str>>()[1]
|
||||
.split("<").collect::<Vec<&str>>()[0]
|
||||
.split(" ").collect::<Vec<&str>>().last().unwrap_or(&"")
|
||||
@@ -190,6 +194,7 @@ impl OmgxxxProvider {
|
||||
.to_string();
|
||||
|
||||
let tags = video_segment.split("class=\"models\">").collect::<Vec<&str>>()[1]
|
||||
.split("</div>").collect::<Vec<&str>>()[0]
|
||||
.split("href=\"").collect::<Vec<&str>>()[1..]
|
||||
.into_iter().map(
|
||||
|s| format!("@models:{}", s.split("/").collect::<Vec<&str>>()[4]
|
||||
|
||||
Reference in New Issue
Block a user