5 Commits

Author SHA1 Message Date
Bnyro
a6bb1ecf87 [build] /static 2025-10-17 15:59:53 +02:00
Bnyro
636738779e [feat] video results: display video length on video thumbnail 2025-10-17 15:59:53 +02:00
Bnyro
1d138c5968 [mod] bing engine: follow redirects (#5324)
Apparently, in China, Bing redirects from `www.bing.com` to `cn.bing.com`.
So in order to make Bing work for chinese users by default, we have to follow that redirect.

related: https://github.com/searxng/searxng/issues/5243
2025-10-17 15:43:49 +02:00
Markus Heiser
3e7e404fda [fix] issues reported by Pylint 4.0
Last major update of Pylint brings some breaking changes [1], fixed in this
patch.

[1] https://pylint.readthedocs.io/en/latest/whatsnew/4/4.0/index.html#breaking-changes
2025-10-17 15:42:22 +02:00
dependabot[bot]
602a73df9a [upd] pypi: Bump pylint from 3.3.9 to 4.0.1
Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.9 to 4.0.1.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.9...v4.0.1)

---
updated-dependencies:
- dependency-name: pylint
  dependency-version: 4.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-17 15:42:22 +02:00
8 changed files with 48 additions and 33 deletions

View File

@@ -162,7 +162,7 @@ no-docstring-rgx=^_
property-classes=abc.abstractproperty
# Regular expression matching correct variable names
variable-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*)|([a-z]))$
variable-rgx=([a-zA-Z0-9_]*)$
[FORMAT]

View File

@@ -169,6 +169,17 @@ article[data-vim-selected].category-social {
.rounded-corners;
}
.image-label-bottom-right() {
position: absolute;
right: 0;
bottom: 0;
background: var(--color-image-resolution-background);
padding: 0.3rem 0.5rem;
font-size: 0.9rem;
color: var(--color-image-resolution-font);
border-top-left-radius: 0.3rem;
}
.result {
margin: @results-margin 0;
padding: @result-padding;
@@ -295,12 +306,22 @@ article[data-vim-selected].category-social {
color: var(--color-result-description-highlight-font);
}
img.thumbnail {
a.thumbnail_link {
position: relative;
margin-top: 0.6rem;
.ltr-margin-right(1rem);
.ltr-float-left();
padding-top: 0.6rem;
.ltr-padding-right(1rem);
width: 7rem;
height: unset; // remove height value that was needed for lazy loading
img.thumbnail {
width: 7rem;
height: unset; // remove height value that was needed for lazy loading
display: block;
}
.thumbnail_length {
.image-label-bottom-right();
right: 6px;
}
}
.break {
@@ -391,23 +412,19 @@ article[data-vim-selected].category-social {
}
.result-videos {
img.thumbnail {
.ltr-float-left();
padding-top: 0.6rem;
.ltr-padding-right(1rem);
a.thumbnail_link img.thumbnail {
width: 20rem;
height: unset; // remove height value that was needed for lazy loading
}
}
.result-videos .content {
overflow: hidden;
}
.content {
overflow: hidden;
}
.result-videos .embedded-video iframe {
width: 100%;
aspect-ratio: 16 / 9;
padding: 10px 0 0 0;
.embedded-video iframe {
width: 100%;
aspect-ratio: 16 / 9;
padding: 10px 0 0 0;
}
}
@supports not (aspect-ratio: 1 / 1) {
@@ -472,14 +489,7 @@ article[data-vim-selected].category-social {
}
.image_resolution {
position: absolute;
right: 0;
bottom: 0;
background: var(--color-image-resolution-background);
padding: 0.3rem 0.5rem;
font-size: 0.9rem;
color: var(--color-image-resolution-font);
border-top-left-radius: 0.3rem;
.image-label-bottom-right();
}
span.title,

View File

@@ -2,7 +2,7 @@ mock==5.2.0
nose2[coverage_plugin]==0.15.1
cov-core==1.15.0
black==25.9.0
pylint==3.3.9
pylint==4.0.1
splinter==0.21.0
selenium==4.36.0
Pallets-Sphinx-Themes==2.3.0

View File

@@ -108,6 +108,10 @@ def request(query, params):
time_ranges = {'day': '1', 'week': '2', 'month': '3', 'year': f'5_{unix_day-365}_{unix_day}'}
params['url'] += f'&filters=ex1:"ez{time_ranges[params["time_range"]]}"'
# in some regions where geoblocking is employed (e.g. China),
# www.bing.com redirects to the regional version of Bing
params['allow_redirects'] = True
return params

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -30,14 +30,15 @@
{%- endfor %}
</div>
{{- result_close_link() -}}
{%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" loading="lazy">{{ result_close_link() }}{% endif -%}
{%- if result.thumbnail %}{{ result_open_link(result.url, classes='thumbnail_link') }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" loading="lazy">{%- if result.length -%}<span class="thumbnail_length">{{ result.length }}</span>{%- endif -%}{{ result_close_link() }}{% endif -%}
<h3>{{ result_link(result.url, result.title|safe) }}</h3>
{%- endmacro -%}
<!-- Draw result sub header -->
{%- macro result_sub_header(result) -%}
{%- if result.publishedDate %}<time class="published_date" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif -%}
{%- if result.length %}<div class="result_length">{{ _('Length') }}: {{ result.length }}</div>{% endif -%}
<!-- Length is displayed inside the thumbnail if there's any, so don't display it here a second time -->
{%- if result.length and not result.thumbnail %}<div class="result_length">{{ _('Length') }}: {{ result.length }}</div>{% endif -%}
{%- if result.views %}<div class="result_views">{{ _('Views') }}: {{ result.views }}</div>{% endif -%}
{%- if result.author %}<div class="result_author">{{ _('Author') }}: {{ result.author }}</div>{% endif -%}
{%- if result.metadata %}<div class="highlight">{{ result.metadata|safe }}</div>{% endif -%}

View File

@@ -42,7 +42,7 @@ test.pylint() {
build_msg TEST "[pylint] ./searx ./searxng_extra ./tests"
# shellcheck disable=SC2086
pylint ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \
--ignore=searx/engines \
--ignore-paths=searx/engines \
searx searx/searxng.msg \
searxng_extra searxng_extra/docs_prebuild \
tests