summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorjazzzooo <38244149+jazzzooo@users.noreply.github.com>2023-09-13 10:21:01 +0000
committerMarkus Heiser <markus.heiser@darmarIT.de>2023-09-13 21:39:37 +0200
commitb98907e91fbc845194580307cb23e057bdc2ac27 (patch)
treef4c5a52da4460aa957f3f41f1da411d862bbbc6a /searx/engines
parent6039dbf2112d8bd78dba189562a19a92d04f7907 (diff)
downloadsearxng-b98907e91fbc845194580307cb23e057bdc2ac27.tar.gz
searxng-b98907e91fbc845194580307cb23e057bdc2ac27.zip
[fix] engine - piped.music incorrect timestamps
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/piped.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/searx/engines/piped.py b/searx/engines/piped.py
index 2bfb90656..34a5a0a13 100644
--- a/searx/engines/piped.py
+++ b/searx/engines/piped.py
@@ -130,13 +130,14 @@ def response(resp):
json = resp.json()
for result in json["items"]:
- publishedDate = parser.parse(time.ctime(result.get("uploaded", 0) / 1000))
+ # note: piped returns -1 for all upload times when filtering for music
+ uploaded = result.get("uploaded", -1)
item = {
# the api url differs from the frontend, hence use piped.video as default
"url": _frontend_url() + result.get("url", ""),
"title": result.get("title", ""),
- "publishedDate": publishedDate,
+ "publishedDate": parser.parse(time.ctime(uploaded / 1000)) if uploaded != -1 else None,
"iframe_src": _frontend_url() + '/embed' + result.get("url", ""),
}