Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
826ef3d0
Unverified
Commit
826ef3d0
authored
Apr 15, 2020
by
Noémi Ványi
Committed by
GitHub
Apr 15, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1879 from bauruine/fix_startpage_ValueError_on_spanish_datetime
[Fix] Startpage ValueError on Spanish date format
parents
4eddbca8
fcb44c65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
startpage.py
searx/engines/startpage.py
+5
-2
No files found.
searx/engines/startpage.py
View file @
826ef3d0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment