-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example stopped working #15
Comments
Hello, and thanks for reaching out. An empty results list usually means that DuckDuckGo has blocked your IP. I have just tried here with my home IP, and it worked fine: >>> from duckpy import Client
>>> client = Client()
>>> results = client.search("Python Wikipedia")
>>> print(results[0])
{'title': 'Python (programming language) - Wikipedia', 'description': 'Python is a high-level, general-purpose programming language.Its design philosophy emphasizes code readability with the use of significant indentation.. Python is dynamically typed and garbage-collected.It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming.It is often described as a "batteries included" language ...', 'url': 'https://en.wikipedia.org/wiki/Python_(programming_language)'} Either way, an error should be raised if your IP is blocked, rather than just blindly returning an empty list (which is also the behaviour for not found queries). This project was made in a very rudimentary way, so there's a lot of room for improvements. |
Hi Alisson,
Am Thu, Feb 08, 2024 at 07:12:35AM -0800 schrieb Alisson L.:
Hello, and thanks for reaching out. An empty results list usually means that DuckDuckGo has blocked your IP. I have just tried here with my home IP, and it worked fine:
Argh, what might be the reason for blocking on one hand Debian infrastructure from where the first test was run as well as my own private IP?
Either way, an error should be raised if your IP is blocked, rather than just blindly returning an empty list (which is also the behaviour for not found queries). This project was made in a very rudimentary way, so there's a lot of room for improvements.
Does it mean a lot of work for you to implement the distinction between a block and not found queries. We could probably sensibly close the Debian bug report by drafting a more senible CI test using this feature.
Kind regards, Andreas.
|
Hi,
if I try to run your simple example from
README.md
I get:This has led to a bug for the Debian packaged duckpy. The problem exists for Python3.11 and Python3.12.
Kind regards, Andreas.
The text was updated successfully, but these errors were encountered: