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
86a378bd
Commit
86a378bd
authored
Jan 02, 2020
by
Adam Tauber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] handle missing thumbnail
parent
2dc2e1e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
ina.py
searx/engines/ina.py
+6
-3
No files found.
searx/engines/ina.py
View file @
86a378bd
...
...
@@ -32,7 +32,7 @@ base_url = 'https://www.ina.fr'
search_url
=
base_url
+
'/layout/set/ajax/recherche/result?autopromote=&hf={ps}&b={start}&type=Video&r=&{query}'
# specific xpath variables
results_xpath
=
'//div[contains(@class,"search-results--list")]/
div[@class="media
"]'
results_xpath
=
'//div[contains(@class,"search-results--list")]/
/div[@class="media-body
"]'
url_xpath
=
'.//a/@href'
title_xpath
=
'.//h3[@class="h3--title media-heading"]'
thumbnail_xpath
=
'.//img/@src'
...
...
@@ -65,8 +65,11 @@ def response(resp):
videoid
=
result
.
xpath
(
url_xpath
)[
0
]
url
=
base_url
+
videoid
title
=
p
.
unescape
(
extract_text
(
result
.
xpath
(
title_xpath
)))
thumbnail
=
extract_text
(
result
.
xpath
(
thumbnail_xpath
)[
0
])
if
thumbnail
[
0
]
==
'/'
:
try
:
thumbnail
=
extract_text
(
result
.
xpath
(
thumbnail_xpath
)[
0
])
except
:
thumbnail
=
''
if
thumbnail
and
thumbnail
[
0
]
==
'/'
:
thumbnail
=
base_url
+
thumbnail
d
=
extract_text
(
result
.
xpath
(
publishedDate_xpath
)[
0
])
d
=
d
.
split
(
'/'
)
...
...
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