Closed CezaPasc closed 1 month ago
Try the version with httpx for now:
pip install -U duckduckgo_search==5.3.0b4
Was having same issue, the httpx version fixed it. Thank you.
I am now using this version and I am still facing the same issue.
duckduckgo_search 5.3.0b4
Do I also have to change something in the code, like specifying a different backend?
Trying the suggested version (5.3.0b4) also solved the problem for me.
pip install -U duckduckgo_search==5.3.0b4
In case you are using Windows, you also have to change the default EventLoopPolicy of asyncio library BEFORE importing the other libraries.
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
I don't know if I will be rate-limited again with the httpx version after a while...
@DavidEstape
In case you are using Windows, you also have to change the default EventLoopPolicy of asyncio library BEFORE importing the other libraries.
This is applied automatically: https://github.com/deedy5/duckduckgo_search/blob/fce7fab463934f9e4d844ca5ca40a185a656a468/duckduckgo_search/__init__.py#L18C1-L19C76
@CezaPasc
I am now using this version and I am still facing the same issue. duckduckgo_search 5.3.0b4 Do I also have to change something in the code, like specifying a different backend?
Changing the backend
parameter will not provide any benefits.
@DavidEstape
In case you are using Windows, you also have to change the default EventLoopPolicy of asyncio library BEFORE importing the other libraries.
This is applied automatically: https://github.com/deedy5/duckduckgo_search/blob/fce7fab463934f9e4d844ca5ca40a185a656a468/duckduckgo_search/__init__.py#L18C1-L19C76
Yes. You are correct. I tried without and no warning now, so no need to change the EventLoopPolicy. Thank you for your effort.
@CezaPasc
There's a new version (v5.3.1) out, give it a try.
pip install -U duckduckgo_search
Could it be that the problem is somehow on my fault?
I tested it now again twice: in the same environment and then on an other server (using Linux instead of Mac OS) with a fresh Python environment only having duckduckgo_search installed.
duckduckgo_search 5.3.1
Still running into the same after update to v5.3.1. Was running 1 search per 3-5 sec for total ~50 searches. The error message is bit confusing since I can see the search output in the provide url. Do we just wait it out for soft block period or there is a fix?
RatelimitException: https://links.duckduckgo.com/d.js?q=sklearn+repo+site%3Agithub.com&kl=wt-wt&l=wt-wt&p=&s=0&df=&vqd=4-292300349075791261695672170567302953005&ex=-1 202 Ratelimit
duckduckgo_search==5.3.0b4 works for me while 5.3.1 still fails
I'll leave my two cents here. I was using this lib with langchain inside Collaboratory. Restarting the runtime fixed it, while every other solution didn't. Edit: Doesn't seem to always solve the issue
I am using windows system its working after adding code below code before
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
from duckduckgo_search import DDGS
results = DDGS().text("who twitter ceo", max_results=5)
print(results)
Thanks @DavidEstape
What is the current situation? Does anyone have v5.3.1 or 5.3.1b1 working?
Neither 5.3.1 nor 5.3.1b1 is working for me. In my case, it freezes forever instead of raising an exception. However, 5.3.0b4 seems to be working.
Update to v6.0.0
Describe the bug
I am getting rate-limited receiving a 202 Status Code even though I am waiting at least 1 minute between the requests. It usually happens after 6-7 requests I'm not sure if it matters, but I'm still able to visit
https://duckduckgo.com/
in the browser after being rate-limited.Steps to reproduce the problem: The problem can be reproduced executing this:
Exception:
duckduckgo_search.exceptions.RatelimitException: https://duckduckgo.com/ 202 Ratelimit
Specify this information