You can set the default directory like this: my_downloader = simp.simple_image_download() The directory where the Picture are saved, default is in ‘simple_images/’. flash_cache():Ĭlears the class instance’s cache which is stored in instance.cached_urls Usefule in case of a picture that is not been found, so won't allow to loop indefinitely. Remember to clear the cache afterwards with Downloader.flush_cache Pictures have a unique ID, so that multiple downloads can persomeĭownload_cache => allows to download all the URLs stored in the Downloader's instance Cache. The directory is named after the Keyword.This functions downloads pictures into defined class instance’s directory: download(keywords, limit, verbose=False, cache=True, download_cache=False, timer=None) In the function scan_webpage a 100_000 lookkup means that it will loop up to 100_000 before stop. Timer => Default is set to 100_000 Looks up, defines the number of WebPages's 'chunks' will search. Verbose => Output the links in the terminal in real timeĬache => if set to False, the URLs won’t be stored in the class instance, default is True How many picture per keyword you need with the limit parameter.File Extensions based on the class instance you define.This functions returns and Caches URLs of Pictures based on: extension - Type of extension allowed to be downloaded, if left None defaults are:įunctions search_urls(keywords, limit, verbose=False, cache=True, timer=None).API class simple_image_download.Downloader(extensions=None) Get Only the Pictures URL and Store them in the Class cache: from simple_image_download import Downloader simp Response.download(‘bear supermario’, limit=5) Next you can use response to activate methods: response.download(keywords, )ĭownloads Images from simple_image_download import Downloader simp Then create a new class instance response = simp.simple_image_download() The main class is Download import it in your project as so: from simple_image_download import Downloader simp ĭrop the dlls in C:\Windows\System32 and python magic will import correctly. If you are using a 64-bit build of python, you'll need 64-bit libmagic binaries which can be found here. Pip install python-magic-bin=0.4.14 Window 64-bit!!! You'll need DLLs for libmagic Here the includes binaries to PyPI. Use command pip install simple_image_download Note on Windows for python-magic 0.4.18 which is used for this Project Python script that lets you search for urls of images from google images using your tags and/or download them automatically onto you computer Documentationĭownload simple-image-download.py from my github and use it in your project
0 Comments
Leave a Reply. |