mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-08 00:19:59 +02:00
don't attempt to redownload embeded images
This commit is contained in:
parent
4f5aef8e17
commit
5f82872d1f
1 changed files with 13 additions and 11 deletions
|
@ -66,6 +66,7 @@ impl ImageDownloader {
|
|||
evaluate_xpath!(context, xpath, node_vec);
|
||||
for mut node in node_vec {
|
||||
if let Some(url) = node.get_property("src") {
|
||||
if !url.starts_with("data:") {
|
||||
if let Ok(url) = url::Url::parse(&url) {
|
||||
let parent_url = match self.check_image_parent(&node, &url) {
|
||||
Ok(url) => Some(url),
|
||||
|
@ -85,6 +86,7 @@ impl ImageDownloader {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue