mirror of
https://github.com/searxng/searxng.git
synced 2024-12-01 15:11:03 +00:00
[fix] ccc_media engine: filter video formats and ignore audio & SubRip
CCC media serves several recording formats, to name a few: - application/x-subrip - video/mp4 - video/webm - audio/mpeg - audio/opus - audio/mpeg not all of them are suitable for a video frame. If available we should prefer video/mp4 due to its minimal data rates. Closes: https://github.com/searxng/searxng/issues/3431 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
ecee56533c
commit
e6c345f890
1 changed files with 7 additions and 2 deletions
|
@ -35,8 +35,13 @@ def response(resp):
|
||||||
publishedDate = parser.parse(item['date'])
|
publishedDate = parser.parse(item['date'])
|
||||||
|
|
||||||
iframe_src = None
|
iframe_src = None
|
||||||
if len(item['recordings']) > 0:
|
for rec in item['recordings']:
|
||||||
iframe_src = item['recordings'][0]['recording_url']
|
if rec['mime_type'].startswith('video'):
|
||||||
|
if not iframe_src:
|
||||||
|
iframe_src = rec['recording_url']
|
||||||
|
elif rec['mime_type'] == 'video/mp4':
|
||||||
|
# prefer mp4 (minimal data rates)
|
||||||
|
iframe_src = rec['recording_url']
|
||||||
|
|
||||||
results.append(
|
results.append(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue