Markus Heiser
dc29f1d826
[pylint] tag PYLINT_FILES by comment `# lint: pylint`
...
These py files are linted by `test.pylint`, all other files are linted by
`test.pep8`.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 years ago
Alexandre Flament
ca93a01844
[mod] dynamically set language_support variable
...
The language_support variable is set to True by default,
and set to False in only 5 engines.
Except the documentation and the /config URL, this variable is not used.
This commit remove the variable definition in the engines, and
set value according to supported_languages length: False when the length is 0,
True otherwise.
Close #2485
4 years ago
Markus Heiser
b1fefec40d
[fix] normalize the language & region aspects of all google engines
...
BTW: make the engines ready for search.checker:
- replace eval_xpath by eval_xpath_getindex and eval_xpath_list
- google_images: remove outer try/except block
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 years ago
Alexandre Flament
8c46b767d0
[fix] google_news: avoid one HTTP redirect except for the English results
...
also add
params['soft_max_redirects'] = 1
to avoid false error reporting in /stats/errors
4 years ago
Markus Heiser
5f92dfcdbe
[fix] google-news: query uses locale without country tag
...
Wthout country-region tag google will redirect to correct the contry tag [1]:
SEARX_DEBUG=1 searx-checker -v "google news"
...
https://news.google.com:443 "GET /search?q=computer&hl=en... HTTP/1.1" 302 0
https://news.google.com:443 "GET /search?q=computer&hl=en-US&.... HTTP/1.1" 200 None
...
[1] https://github.com/searx/searx/pull/2483#issuecomment-765600849
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 years ago
Markus Heiser
baec54c492
[fix] revise of the google-news engine
...
This revise is based on the methods developed in the revise of the google engine
(see commit 410c2f9
).
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 years ago
Alexandre Flament
a4dcfa025c
[enh] engines: add about variable
...
move meta information from comment to the about variable
so the preferences, the documentation can show these information
4 years ago
Alexandre Flament
b00d108673
[mod] pylint: numerous minor code fixes
4 years ago
Alexandre Flament
3038052c79
[mod] remove unused import
...
use
from searx.engines.duckduckgo import _fetch_supported_languages, supported_languages_url # NOQA
so it is possible to easily remove all unused import using autoflake:
autoflake --in-place --recursive --remove-all-unused-imports searx tests
4 years ago
Dalf
1022228d95
Drop Python 2 (1/n): remove unicode string and url_utils
4 years ago
Markus Heiser
c89c05bceb
bugfix: google-news and bing-news has changed the language parameter
...
closes: https://github.com/asciimoo/searx/issues/1838
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
5 years ago
Noémi Ványi
b63d645a52
Revert "remove 'all' option from search languages"
...
This reverts commit 4d1770398a
.
6 years ago
Marc Abonce Seguin
5568f24d6c
[fix] check language aliases when setting search language
6 years ago
Marc Abonce Seguin
835d1edd58
[fix] google news xpath
7 years ago
Marc Abonce Seguin
772c048d01
refactor engine's search language handling
...
Add match_language function in utils to match any user given
language code with a list of engine's supported languages.
Also add language_aliases dict on each engine to translate
standard language codes into the custom codes used by the engine.
7 years ago
marc
4d1770398a
remove 'all' option from search languages
7 years ago
misnyo
3182ba7069
[fix] google news dom xpath fix
7 years ago
Adam Tauber
52e615dede
[enh] py3 compatibility
8 years ago
Adam Tauber
108392f8da
[fix] skip non-complete google news results
8 years ago
Adam Tauber
8bff42f049
Merge branch 'master' into languages
8 years ago
Adam Tauber
0171db5c3f
[fix] handle missing images in google news
8 years ago
marc
af35eee10b
tests for _fetch_supported_languages in engines
...
and refactor method to make it testable without making requests
8 years ago
marc
f62ce21f50
[mod] fetch supported languages for several engines
...
utils/fetch_languages.py gets languages supported by each engine and
generates engines_languages.json with each engine's supported language.
8 years ago
marc
149802c569
[enh] add supported_languages on engines and auto-generate languages.py
8 years ago
Noémi Ványi
c59c76e6ee
add year to time range to engines which support "Last year"
...
Engines:
* Bing images
* Flickr (noapi)
* Google
* Google Images
* Google News
8 years ago
Adam Tauber
a2c94895c1
[fix] google news engine change follow-up
8 years ago
Alexandre Flament
4689fe341c
update versions.cfg to use the current up-to-date packages
10 years ago
Cqoicebordel
b7dc1fb9d5
Google news' unit test
10 years ago
dalf
7c13d630e4
[fix] pep8 : engines (errors E121, E127, E128 and E501 still exist)
10 years ago
Thomas Pointhuber
144f89bf78
add comments to google-engines
10 years ago
Adam Tauber
ce08abe223
[fix] remove unused imports ++ pep8
11 years ago
Thomas Pointhuber
337bd6d907
simplify datetime extraction
11 years ago
Adam Tauber
b735093564
[fix] pep8
11 years ago
Thomas Pointhuber
b88146d669
showing publishedDate for news
11 years ago
Adam Tauber
98b6313d5d
[fix] pep8
11 years ago
Thomas Pointhuber
0549f8c7c8
Create google_news.py
11 years ago