yagooglesearch icon indicating copy to clipboard operation
yagooglesearch copied to clipboard

Always required lang lang_result

Open vasile-corobceanu opened this issue 11 months ago • 3 comments

Why lang_result is required?

vasile-corobceanu avatar Mar 13 '25 16:03 vasile-corobceanu

Hi @vasile-corobceanu

Can you clarify how you're using it and/or what issues you're seeing? It shouldn't be required, since the default is lang_en when instantiating the SearchClient class (see https://github.com/opsdisk/yagooglesearch/blob/master/src/yagooglesearch/init.py#L87)

If provided, the only other requirement is that the language exists in https://github.com/opsdisk/yagooglesearch/blob/master/src/yagooglesearch/result_languages.txt

(see https://github.com/opsdisk/yagooglesearch/blob/master/src/yagooglesearch/init.py#L174)

opsdisk avatar Mar 14 '25 02:03 opsdisk

Hi @opsdisk Why does lang_result have a default value? Google allows making requests without specifying a language. I need to perform searches with any_lang. Is there a way to disable or bypass this restriction?

vasile-corobceanu avatar Mar 14 '25 06:03 vasile-corobceanu

yagooglsearch is heavily based off the googlesearch library...so I guess I just kept that requirement since it came from here. Maybe it helped with not looking like a bot? If you have any more historical info about it, please let me know.

For a quick hack, if you don't want to include it, you'd have to modify the 4 URL creation lines in the the update_urls function by removing lr={self.lang_result}&. Then re-install yagooglesearch.

Image

opsdisk avatar Mar 14 '25 12:03 opsdisk