diff options
author | Bnyro <bnyro@tutanota.com> | 2023-10-07 10:57:47 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2023-10-07 11:45:46 +0200 |
commit | f22daf8b478c287962e0864d813e88195567ab4e (patch) | |
tree | 0745c6968b7f3c5ff42291aefe1cb6abbb600691 /searx | |
parent | ce270961e82585971579844c64d7cde5f5d855ec (diff) | |
download | searxng-f22daf8b478c287962e0864d813e88195567ab4e.tar.gz searxng-f22daf8b478c287962e0864d813e88195567ab4e.zip |
[mod] piped: always show video length if available
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/piped.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/piped.py b/searx/engines/piped.py index a943f7e3a..5b4cbded3 100644 --- a/searx/engines/piped.py +++ b/searx/engines/piped.py @@ -140,6 +140,9 @@ def response(resp): "publishedDate": parser.parse(time.ctime(uploaded / 1000)) if uploaded != -1 else None, "iframe_src": _frontend_url() + '/embed' + result.get("url", ""), } + length = result.get("duration") + if length: + item["length"] = datetime.timedelta(seconds=length) if piped_filter == 'videos': item["template"] = "videos.html" @@ -151,9 +154,6 @@ def response(resp): item["template"] = "default.html" item["img_src"] = result.get("thumbnail", "") item["content"] = result.get("uploaderName", "") or "" - length = result.get("duration") - if length: - item["length"] = datetime.timedelta(seconds=length) results.append(item) |