diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2020-04-19 12:03:14 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarit.de> | 2020-04-19 12:03:14 +0200 |
| commit | 4b4e95f2c3ebf4858a370f2c91783104afc1e198 (patch) | |
| tree | ac1dc221441dd5d4f60e898b2206456bfe74c08e | |
| parent | f2ca12b54fdec72cdf0ac906d616e5c8b1fd1cb3 (diff) | |
| parent | 826ef3d00959f22a57224fa5e69fb088583f0072 (diff) | |
Merge branch 'master' of https://github.com/asciimoo/searx into filtron
| -rw-r--r-- | requirements.txt | 16 | ||||
| -rw-r--r-- | searx/engines/startpage.py | 7 |
2 files changed, 13 insertions, 10 deletions
diff --git a/requirements.txt b/requirements.txt index ea4a5a7a0..5d508d7ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ -certifi==2019.3.9 +certifi==2020.4.5.1 babel==2.7.0 flask-babel==1.0.0 -flask==1.0.2 -idna==2.8 -jinja2==2.10.1 -lxml==4.3.3 +flask==1.1.2 +idna==2.9 +jinja2==2.11.1 +lxml==4.5.0 pygments==2.1.3 -pyopenssl==19.0.0 +pyopenssl==19.1.0 python-dateutil==2.8.0 -pyyaml==5.1 -requests[socks]==2.22.0 +pyyaml==5.3.1 +requests[socks]==2.23.0 diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py index 76567396f..953734934 100644 --- a/searx/engines/startpage.py +++ b/searx/engines/startpage.py @@ -99,11 +99,14 @@ def response(resp): if re.match(r"^([1-9]|[1-2][0-9]|3[0-1]) [A-Z][a-z]{2} [0-9]{4} \.\.\. ", content): date_pos = content.find('...') + 4 date_string = content[0:date_pos - 5] - published_date = parser.parse(date_string, dayfirst=True) - # fix content string content = content[date_pos:] + try: + published_date = parser.parse(date_string, dayfirst=True) + except ValueError: + pass + # check if search result starts with something like: "5 days ago ... " elif re.match(r"^[0-9]+ days? ago \.\.\. ", content): date_pos = content.find('...') + 4 |