Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com search engine. Downloading files and images to a local hard drive.
MIT License
932
stars
117
forks
source link
Search with site: resulting in RateLimitException #144
Describe the bug
Very frequently, maybe all the time, queries for a specific site result in RateLimitException.
This problem happens with both API calls and the ddgs script. I am showing the behavior with ddgs script because it is faster to reproduce without pasting any code here:
This works fine and give me two results:
ddgs text -k 'ayrton senna' -m 2
This doest not work and give me the following error:
ddgs text -k 'ayrton senna site:wikipedia.org' -m 2
Traceback (most recent call last):
File "/Users/joao/miniforge3/envs/test_ddg/bin/ddgs", line 8, in <module>
sys.exit(cli())
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/click/core.py", line 1719, in invoke
rv.append(sub_ctx.command.invoke(sub_ctx))
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/duckduckgo_search/cli.py", line 150, in text
for r in DDGS(proxies=proxy).text(
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/duckduckgo_search/duckduckgo_search.py", line 105, in text
for i, result in enumerate(results, start=1):
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/duckduckgo_search/duckduckgo_search.py", line 156, in _text_api
resp = self._get_url("GET", "https://links.duckduckgo.com/d.js", params=payload)
File "/Users/joao/miniforge3/envs/test_ddg/lib/python3.10/site-packages/duckduckgo_search/duckduckgo_search.py", line 48, in _get_url
raise RateLimitException(f"_get_url() {url}")
duckduckgo_search.exceptions.RateLimitException: _get_url() https://links.duckduckgo.com/d.js
Describe the bug Very frequently, maybe all the time, queries for a specific site result in
RateLimitException
. This problem happens with both API calls and the ddgs script. I am showing the behavior with ddgs script because it is faster to reproduce without pasting any code here:This works fine and give me two results:
ddgs text -k 'ayrton senna' -m 2
This doest not work and give me the following error:
Specify this information
OS: Apple M1 Pro Macos 14.0
environment New conda env created with:
Output of pip freeze:
Thanks in advance for having a look at it and thanks for the amazing package! Joao