mirror of https://github.com/searxng/searxng.git
[fix] engine - piped.music incorrect timestamps
This commit is contained in:
parent
6039dbf211
commit
b98907e91f
|
@ -130,13 +130,14 @@ def response(resp):
|
||||||
json = resp.json()
|
json = resp.json()
|
||||||
|
|
||||||
for result in json["items"]:
|
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 = {
|
item = {
|
||||||
# the api url differs from the frontend, hence use piped.video as default
|
# the api url differs from the frontend, hence use piped.video as default
|
||||||
"url": _frontend_url() + result.get("url", ""),
|
"url": _frontend_url() + result.get("url", ""),
|
||||||
"title": result.get("title", ""),
|
"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", ""),
|
"iframe_src": _frontend_url() + '/embed' + result.get("url", ""),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue