mnewt / counsel-web

Search the Web using Ivy
GNU General Public License v3.0
34 stars 2 forks source link

Web suggest links not accessible, with messy numbers #3

Closed duzaichuan closed 3 years ago

duzaichuan commented 3 years ago

counsel-web

Manjaro, emacs 27.2. Any suggestions? Thanks.

mnewt commented 3 years ago

I've seen this before. DuckDuckGo tacks that &rut= business onto URLs when it doesn't like the User Agent (presumably as some sort of bot security measure). In the past, setting a User Agent of "Emacs" was sufficient to get rid of it. Now it seems it doesn't like that anymore.

I just tried to make this work with the User Agent that url sets, and it didn't work any better. For me, that is:

User-Agent: URL/Emacs Emacs/28.0.50 (OpenStep; x86_64-apple-darwin20.4.0)

I tried a few random User Agent strings and some of them worked. But many that I expected to work didn't. So I don't know what their problem is. I'm starting to think that just living with that suffix and stripping it off is the better approach.

Edited to add: I'll push an update that strips that bit out.

mnewt commented 3 years ago

Looks like that fixed it for me. @duzaichuan how about you?

duzaichuan commented 3 years ago

Works! Thank you~