Compare commits

...

3 commits

Author SHA1 Message Date
Markus Heiser 7e8055d8dd
Merge bcab8ec575 into ecee56533c 2024-04-27 20:29:30 +02:00
Jinyuan Huang ecee56533c improve "search existing issues from github" link 2024-04-27 20:01:27 +02:00
Markus Heiser bcab8ec575 [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>
2024-04-27 17:20:53 +02:00
3 changed files with 24 additions and 3 deletions

View file

@ -35,8 +35,13 @@ def response(resp):
publishedDate = parser.parse(item['date'])
iframe_src = None
if len(item['recordings']) > 0:
iframe_src = item['recordings'][0]['recording_url']
for rec in item['recordings']:
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(
{

View file

@ -63,7 +63,7 @@ or manually by executing the searx/webapp.py file? -->
<input type="checkbox" id="step1">
<label for="step1">{{ _('Start submiting a new issue on GitHub') }}</label>
<div class="step1 step_content">
<p><a href="{{ get_setting('brand.issue_url') }}?q=is%3Aissue+Bug:%20{{ engine_name }}" target="_blank" rel="noreferrer noreferrer">{{ _('Please check for existing bugs about this engine on GitHub') }}</a></p>
<p><a href="{{ get_setting('brand.issue_url') }}?q=is%3Aissue+Bug:%20{{ engine_name }} {{ technical_report }}" target="_blank" rel="noreferrer noreferrer">{{ _('Please check for existing bugs about this engine on GitHub') }}</a></p>
</div>
<input class="step1 step1_delay" type="checkbox" id="step2">
<label class="step1 step1_delay" for="step2" >{{ _('I confirm there is no existing bug about the issue I encounter') }}</label>

View file

@ -1161,6 +1161,21 @@ def stats():
reliability_order = 1 - reliability_order
return (reliability_order, key, engine_stat['name'])
technical_report = []
for error in engine_reliabilities.get(selected_engine_name, {}).get('errors', []):
technical_report.append(
f"\
Error: {error['exception_classname'] or error['log_message']} \
Parameters: {error['log_parameters']} \
File name: {error['filename'] }:{ error['line_no'] } \
Error Function: {error['function']} \
Code: {error['code']} \
".replace(
' ' * 12, ''
).strip()
)
technical_report = ' '.join(technical_report)
engine_stats['time'] = sorted(engine_stats['time'], reverse=reverse, key=get_key)
return render(
# fmt: off
@ -1170,6 +1185,7 @@ def stats():
engine_reliabilities = engine_reliabilities,
selected_engine_name = selected_engine_name,
searx_git_branch = GIT_BRANCH,
technical_report = technical_report,
# fmt: on
)