Comments (5)
Great work. Really like what you have done with this.
from google-images-download.
@eamonnkenny thanks for your feedback :-)
This script, as you know would run from Command Line Interface. With that, could you tell me how do you propose it to be used from within other python files? Like even if the methods were put in classes, how would it still be like an API?
For now, the best way to call this from within another python file would be
subprocess.call("googleimagesdownload -cf config.json)
and have all the arguments in the config (JSON) file. And since it is JSON format, it could also be automated as required.
Thnx
from google-images-download.
The issue is that with an API the individual using it does not want to have all the configuration in one script. I for instance would like to use it as an API with some default behaviour, downloading 10 labeled for reuse images given some input search string that changes each time.
(by the way, typos related to labled instead of labeled in your main calling function, need fixing)
I've attached a calling function that includes a class. Basically its probably better if you use a class instead of a function call and this gives people the ability to manipulate some of the variables.
I have to say you have done a great job on this as it stands. I really like the results that the functions use and you have so much added functionality and configurability. Its great.
I've attached a workaround for what I am trying to do. I basically wrapped your code up in a class.
The class could be extended to have a whole lot more default arguments. I also have the ability at the moment to just add in extra arguments (this isn't actually the way to do it), but it would be nicer if every single argument can be passed to a constructor of a class. The calling function can be basically what you have with lots of arguments and then fed into the class afterwards. Hope this makes sense. That way the class then becomes the front for the API calls. The command line main function is just a usage of the API.
from google-images-download.
@eamonnkenny thanks for the suggestion. The new version of this lib allows you to call it from another python file. An example is provided in the docs. You can now create an object and pass on the parameters inside it.
Had to make a lot of changes in the code for good to implement this... :D . Few minor changes around the edges will be done in coming days...but for now this works fine.
Do let me know if this is more usable now.
from google-images-download.
Closing this issue. Seems to be stable on all major OSs.
from google-images-download.
Related Issues (20)
- Save image urls to file without downloading images?
- Could not open URL HOT 3
- is there a way for the json to show image description if its in hebrew?
- Images do get downloaded according to the terminal and the log file but do not show up the folder
- Does not work with any search terms. HOT 4
- AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector' HOT 4
- finds zero pics to be downloaded (in a few millis) HOT 2
- 'NoneType' object is not subscriptable error HOT 13
- TypeError: 'NoneType' object is not subscriptable HOT 5
- App is broken HOT 12
- Cannot Use, No Image Downloadable HOT 3
- A way for "ignore_urls" to work when "no_download" is true HOT 1
- cant downlload anything HOT 11
- Hi
- Selenium combined updates HOT 2
- Cannot download more than 20 images HOT 1
- Error Downloading Images Using google-images-download (CLI) Google Colab Available
- Downloaded 0 image using the example this repo document provided HOT 2
- Size parameter does not work
- 关于无法下载图片的猜想
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-images-download.