Comments (1)
Add this function to bing.py
def get_license(self, shorthand):
if shorthand == "creative commons":
return "+filterui:licenseType-Any"
elif shorthand == "public":
return "+filterui:license-L1"
elif shorthand == "share":
return "+filterui:license-L2_L3_L4_L5_L6_L7"
elif shorthand == "modify,share":
return "+filterui:license-L2_L3_L5_L6"
elif shorthand == "commercial share":
return "+filterui:license-L2_L3_L4"
elif shorthand == "commercial modify,share":
return "+filterui:license-L2_L3"
else:
print("[****************] Invalid license type. Defaulting to no license filter.[***********]\nThe available options are [creative commons, public, share, modify,share, commercial share, commercial modify,share]")
return ""
and add the license to the request_url line in run(self) function:
request_url = 'https://www.bing.com/images/async?q=' + urllib.parse.quote_plus(self.query)
+ '&first=' + str(self.page_counter) + '&count=' + str(self.limit)
+ '&adlt=' + self.adult + '&qft=' + ('' if self.filter is None else self.get_filter(self.filter)) + ("" if self.license is None else self.get_license(self.license))
from bing_image_downloader.
Related Issues (20)
- Photo search with txt list
- There should be an option to use an absolute path as out_dir HOT 1
- Not working anymore HOT 3
- Broken, results do not resemble same query via web HOT 2
- Force Replace option not functioning due to typo. HOT 3
- option to keep original image names HOT 1
- Search food, but download many menu images HOT 2
- Error:: URL can't contain control characters. (found at least ' ')
- Worked fine yesterday, but showing error for me today. HOT 4
- Error:: 'ascii' codec can't encode character '\xf1' in position 46: ordinal not in range(128)
- Typo error in the documentation page on pypi.org
- [`Formating`] : Format the code using Black
- Os is not used here
- why joining the search query in the download path, this giving me issues while trying to open the images
- It simply hangs HOT 1
- Getting original URLs
- Why quotation marks do not work? HOT 1
- option to change image names to query_string? HOT 1
- File names manipulation
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 bing_image_downloader.