jarun / ddgr

:duck: DuckDuckGo from the terminal
GNU General Public License v3.0
2.94k stars 139 forks source link

error: 403 (forbidden) #146

Closed kurokirasama closed 2 years ago

kurokirasama commented 2 years ago

Hey, this start happening now....

[ERROR] HTTP Error 403: Forbidden
No results.
keypey commented 2 years ago

Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullsey

Python 3.9.2

[ERROR] HTTP Error 403: Forbidden No results.

jarun commented 2 years ago

Guys, I am seeing results:

$ ./ddgr hello

 1.  Hello Definition & Meaning - Merriam-Webster [www.merriam-webster.com]
     The meaning of HELLO is an expression or gesture of greeting —used interjectionally in greeting, in answering
     the telephone, or to express surprise. How to use hello in a sentence.

 2.  Adele - Hello - YouTube [www.youtube.com]
     Listen to "Easy On Me" here: http://Adele.lnk.to/EOMPre-order Adele's new album "30" before its release on
     November 19: https://www.adele.comShop the "Adele...

 3.  Hello - Wikipedia [en.wikipedia.org]
     According to the Oxford English Dictionary, hello is an alteration of hallo, hollo, [1] which came from Old
     High German " halâ, holâ, emphatic imperative of halôn, holôn to fetch, used especially in hailing a ferryman".
     [5] It also connects the development of hello to the influence of an earlier form, holla, whose origin is in
     the French ...

 4.  The Origin of 'Hello' | Merriam-Webster [www.merriam-webster.com]
     It may be true that OK is the most spoken word on the planet, but hello is a good candidate for the English
     word that most people learn first. The word is so ubiquitous that it's surprising how new it is: hello has only
     been in use for about the last 150 years of the 1000-year history of English.

 5.  HELLO! - Daily royal, celebrity, fashion, beauty & lifestyle news [www.hellomagazine.com]
     HELLO! brings you the latest celebrity & royal news from the UK & around the world, magazine exclusives,
     fashion, beauty, lifestyle news, celeb babies, weddings, pregnancies and more!

 6.  Hello! | Super Simple Songs - YouTube [www.youtube.com]
     More great Super Simple videos in the Super Simple App for iOS http://apple.co/2nW5hPdStart off your lesson
     with "Hello!", a fun and energetic song to talk...

 7.  Hello Definition & Meaning | Dictionary.com [www.dictionary.com]
     Hello definition, (used to express a greeting, answer a telephone, or attract attention.) See more.

 8.  Lionel Richie - Hello (Official Music Video) - YouTube [www.youtube.com]
     REMASTERED IN HD!Explore the music of Lionel Richie: https://lnk.to/LionelBestOf Watch more Lionel videos:
     https://lnk.to/LionelVevo Follow Lionel Richie on....

 9.  HELLO! US Edition - Latest news and Photos [www.hellomagazine.com]
     HELLO! Recommends Shop the 12 biggest deals in Saks Fifth Avenue's Designer Sale. Margot Robbie is a fan of
     this luxury beauty brand - and their new mattifying cream is sure to sell out.

 10. HELLO! Canada edition: Daily news, Celebrity, fashion and beauty [www.hellomagazine.com]
     HELLO! Canada brings you the latest celebrity & royal news from around the world, magazine exclusives, celeb
     babies, weddings, pregnancies and more

ddgr (? for help) 
ddgr (? for help) 

Please check if DDG is blocked in your country/org...

keypey commented 2 years ago

From Poland, UPC. Ddg works fine in browsers. Only cli / ddgr doesn't work.

ddgr hello [ERROR] HTTP Error 403: Forbidden No results. ddgr (? for help)

I checked with vpn (PIA: usa-west / germany). It doesn't work either.

jarun commented 2 years ago

How about: https://html.duckduckgo.com/html ?

keypey commented 2 years ago

It works.

Which country does it work for you?

jarun commented 2 years ago

Working in India.

jarun commented 2 years ago

I would suggest check the class DdgConnection.

Also try to open the html page with elinks and confirm. Can try changing the user agent to elinks one as well.

jarun commented 2 years ago

Also, I am on master.

keypey commented 2 years ago

It's not a country blockade. I connected to PIA-vpn / india.

--- curl ipecho.net/plain ---- 166.0.218.154

ddgr hello [ERROR] HTTP Error 403: Forbidden No results. ddgr (? for help)

elinks - works fine.

keypey commented 2 years ago

I have a workaround. I changed the user-agent in ddgr to:

USER_AGENT = 'Mozilla / 5.0 (X11; Linux x86_64; rv: 104.0) Gecko / 20100101 Firefox / 104.0'

Now it is working.

(only sometimes i get:) [ERROR] <urlopen error [Errno 113] No route to host> No results.