mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 18:24:10 +02:00
improve not found team detection
This commit is contained in:
parent
e71ba3b490
commit
cf8de44bbb
7 changed files with 42 additions and 29 deletions
|
|
@ -132,13 +132,14 @@ impl Parser for TeamParser {
|
|||
.unwrap_or_default()
|
||||
.to_string();
|
||||
|
||||
match (tag.as_str(), name.as_str()) {
|
||||
("", "") => return Err(ScrapeError::NotFound),
|
||||
(_, "") => name = tag.clone(),
|
||||
let image = document.select(&self.selector_image).next();
|
||||
|
||||
match (tag.as_str(), name.as_str(), image.is_some()) {
|
||||
("", "", false) => return Err(ScrapeError::NotFound),
|
||||
(_, "", true) => name = tag.clone(),
|
||||
_ => {}
|
||||
};
|
||||
|
||||
let image = document.select(&self.selector_image).next();
|
||||
let image = image.and_then(|image| {
|
||||
image
|
||||
.attr("data-cfsrc")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue