commonkestrel / image_search Goto Github PK
View Code? Open in Web Editor NEWA crate used to search Google Images based on provided arguments.
License: MIT License
A crate used to search Google Images based on provided arguments.
License: MIT License
Hi,
since the v0.4.2 I can now use this crate, thanks, but it seems that the way Google is now replying prevent for it to works :
11:54:08 [DEBUG] (52) hyper::client::connect::dns: resolving host="www.google.com"
11:54:08 [DEBUG] (48) hyper::client::connect::http: connecting to 142.250.179.68:443
11:54:08 [DEBUG] (48) hyper::client::connect::http: connected to 142.250.179.68:443
11:54:08 [DEBUG] (26) hyper::proto::h1::io: flushed 217 bytes
11:54:08 [DEBUG] (26) hyper::proto::h1::io: read 2764 bytes
11:54:08 [DEBUG] (26) hyper::proto::h1::io: parsed 23 headers
11:54:08 [DEBUG] (26) hyper::proto::h1::conn: incoming body is empty
11:54:08 [DEBUG] (50) hyper::client::pool: pooling idle connection for ("https", www.google.com)
Error: Unable to parse images from json. Google may have changed the way their data is stored
Is it just me ?
extern crate image_search;
use std::path::PathBuf;
use image_search::{Arguments, blocking::{urls, search, download}};
fn main() -> Result<(), image_search::Error> {
let args = Arguments::new("example", 10)
.directory(PathBuf::from("downloads"));
let _image_urls = urls(args.clone())?;
let _images = search(args.clone())?;
let _paths = download(args)?;
Ok(())
}
The above code is from the docs page. I keep getting a Parse error. Not sure why. My Cargo.toml only includes this dependency. Any help would be appreciated.
image_search = { version = "0.4.3", features = ["blocking"] }
Hi,
I am new to rust, but I tried to use your crates to download some pictures from google images (is there a way to pick a random one ?).
But my problem is that in my dependencies I am already have tokio as version 1.26.0.
When starting a simple image search (async) like in your sample, I have this error :
thread 'main' panicked at 'there is no timer running, must be called from the context of a Tokio 0.2.x runtime', /home/ixo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/time/driver/handle.rs:24:32
If I use cargo tree, I see that :
├── image_search v0.4.1
│ ├── async-std v1.12.0
│ │ ├── async-channel v1.8.0
│ │ │ ├── concurrent-queue v2.1.0
│ │ │ │ └── crossbeam-utils v0.8.15 ()
│ │ │ ├── event-listener v2.5.3
│ │ │ └── futures-core v0.3.26
│ │ ├── async-global-executor v2.3.1
│ │ │ ├── async-channel v1.8.0 ()
│ │ │ ├── async-executor v1.5.0
│ │ │ │ ├── async-lock v2.7.0
│ │ │ │ │ └── event-listener v2.5.3
│ │ │ │ ├── async-task v4.3.0
│ │ │ │ ├── concurrent-queue v2.1.0 (*)
│ │ │ │ .... snip ....
│ │ │ ├── once_cell v1.17.1
│ │ │ └── tokio v0.2.25
...
What can we do ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.