Closed Nevrai closed 1 year ago
I solved the issue myself by making sure to use the latest version of duckduckgo-search
, 3.8.3, and making sure I was using version 23.1.0 of aiofiles
. I also made sure I was using the latest versions of click
, httpx
, and lxml
. Thankfully, that solved it!
Hi, Got the same error with 3.8.5 version. Is this really working anymore or the restrictions are too strict ? I'm trying with only one image so no issues of query frequency here.
Use the latest version
I'm in Kaggle and 3.8.5 seems to be the best possible to be installed. Too bad. Thanks for the feedback. I write this in case someone has a workaround for this
Describe the bug
I love
duckduckgo-search
, but I’ve been having issues with fetching images when hosting my script on Cybrancee. My script uses Python 3.10.12.Whilst using the
duckduckgo-search
library to fetch images from DuckDuckGo, I encounter a HTTPError 403 Client Error: Forbidden for url error. This issue does not occur when running the bot locally – only when hosted on Cybrancee, which uses a Pterodactyl panel. Scraping web pages or search engines works fine, and fetching search results withduckduckgo-search
works fine, too. Fetching images is the only thing that does not work.I also tried proxies, headers, and a user agent. However, I still have the same problem.
For some odd reason, I’m able to scrape DuckDuckGo search results with
duckduckgo-search
just fine on my host:However, when scraping image results instead, it does not work. Code:
May be related to #100; however, unlike that issue, it does not happen periodically for me. It happens with every attempt – but only when hosting, not when running the script locally.
I was using version 3.2.0 of
duckduckgo-search
, then updated to the latest version, 3.8.3. However, the issue still occurs in the same way it did before.I have seen #84 and #98. However, you (@deedy5) said that updating might fix it, but it did not. You also said that it’s not a library problem and that a proxy or increasing the time between requests might fix the issue, but in my case, it occurs every time, even if I haven’t made any recent requests, and I have tried both with and without proxies.
The strange anomaly is that it functions perfectly locally but not when hosting on Cybrancee (I have not tried other hosts) – and that using the same library to scrape DDG search results works perfectly with the same headers, UA, and proxies, but when trying to get images, it does not work. I’m not sure what is causing this, but if you could offer some assistance in fixing this issue, it would be much appreciated, as I am quite lost!
Errors
Information
duckduckgo-search
version: 3.8.3 (latest)