mirror of
https://github.com/searxng/searxng.git
synced 2026-09-23 06:36:12 +00:00
[mod] migration of some engine results to the video class (#6743)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
committed by
Markus Heiser
parent
ce48993997
commit
2e41cf7407
@@ -2,7 +2,6 @@
|
||||
"""Utility functions for the engines"""
|
||||
|
||||
from hashlib import pbkdf2_hmac
|
||||
import time
|
||||
|
||||
import re
|
||||
import importlib
|
||||
@@ -816,15 +815,6 @@ def parse_duration_string(duration_str: str) -> timedelta | None:
|
||||
return None
|
||||
|
||||
|
||||
# Format the video duration
|
||||
def format_duration(duration: str | int) -> str:
|
||||
seconds = int(duration)
|
||||
length = time.gmtime(seconds)
|
||||
if length.tm_hour:
|
||||
return time.strftime("%H:%M:%S", length)
|
||||
return time.strftime("%M:%S", length)
|
||||
|
||||
|
||||
def _array_startswith(arr: bytes, prefix: bytes) -> bool:
|
||||
return arr[: len(prefix)] == prefix
|
||||
|
||||
|
||||
Reference in New Issue
Block a user