summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2025-08-07 20:29:07 +0200
committerBnyro <bnyro@tutanota.com>2025-08-08 07:19:12 +0000
commit25c327904a14a8175fbf4782aab625439fd3487a (patch)
treed8b7f59e7d86806ae059e92c78aa71238c0c303a /searx
parent612b76b75e9128201ff4e9042e1f5a2829f7d3cd (diff)
[fix] tagesschau: crash if there's no video stream available
Sometimes, there's only an `adaptivestreaming` field in `streams`, which is usually an m3u8 file. That's however not supported by the video player of any browser, so we can't use and must build a different url instead.
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/tagesschau.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/engines/tagesschau.py b/searx/engines/tagesschau.py
index aa3df6f06..6164d02fd 100644
--- a/searx/engines/tagesschau.py
+++ b/searx/engines/tagesschau.py
@@ -101,6 +101,9 @@ def _video(item):
title = title.replace("_vapp.mxf", "")
title = re.sub(r"APP\d+ (FC-)?", "", title, count=1)
+ # sometimes, only adaptive m3u8 streams are available, so video_url is None
+ url = video_url or f"{base_url}/multimedia/video/{item['sophoraId']}.html"
+
return {
'template': 'videos.html',
'title': title,
@@ -108,5 +111,5 @@ def _video(item):
'publishedDate': datetime.strptime(item['date'][:19], '%Y-%m-%dT%H:%M:%S'),
'content': item.get('firstSentence', ''),
'iframe_src': video_url,
- 'url': video_url,
+ 'url': url,
}