This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dalf
reviewed
Oct 3, 2020
Sorry for the delay. LGTM. even if it is possible to add more information: diff --git a/searx/engines/sepiasearch.py b/searx/engines/sepiasearch.py
index f69d8043..bb2f2289 100644
--- a/searx/engines/sepiasearch.py
+++ b/searx/engines/sepiasearch.py
@@ -38,6 +38,15 @@ time_range_table = {
}
+embedded_url = '<iframe width="540" height="304" src="{url}" frameborder="0" allowfullscreen></iframe>'
+
+
+def minute_to_hm(minute):
+ if isinstance(minute, int):
+ return "%d:%02d"%(divmod(minute, 60))
+ return None
+
+
def request(query, params):
params['url'] = base_url + '?' + urlencode({
'search': query,
@@ -70,13 +79,19 @@ def response(resp):
content = result['description']
thumbnail = result['thumbnailUrl']
publishedDate = parser.parse(result['publishedAt'])
+ embedded = embedded_url.format(url=result.get('embedUrl'))
+ author = result.get('account', {}).get('displayName')
+ length = minute_to_hm(result.get('duration'))
url = result['url']
results.append({'url': url,
'title': title,
'content': content,
+ 'author': author,
+ 'length': length,
'template': 'videos.html',
'publishedDate': publishedDate,
+ 'embedded': embedded,
'thumbnail': thumbnail})
return results |
Thank you ! |
Thank you so much @0xhtml |
mikeri
pushed a commit
to mikeri/searx
that referenced
this pull request
Mar 7, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds the SepiaSearch engine (https://sepiasearch.org).
Why is this change important?
SepiaSearch is a PeerTube search engine that searches through multiple instances of PeerTube. It seems like a nice engine to add.
How to test this PR locally?
Test by searching e.g.
!sep test
.Related issues
Closes #2217