mirror of
https://github.com/searxng/searxng.git
synced 2026-08-05 14:51:25 +00:00
Compare commits
3 Commits
b83e88ea78
...
44405bd03c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44405bd03c | ||
|
|
26e275222b | ||
|
|
ae48f50245 |
@@ -571,13 +571,16 @@ article[data-vim-selected].category-social {
|
|||||||
|
|
||||||
#suggestions {
|
#suggestions {
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: flex;
|
padding-left: 0;
|
||||||
flex-flow: column;
|
margin: 0;
|
||||||
justify-content: flex-end;
|
list-style-position: inside;
|
||||||
|
|
||||||
|
li::marker {
|
||||||
|
color: var(--color-result-link-font);
|
||||||
|
}
|
||||||
|
|
||||||
form {
|
form {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
flex: 1 1 50%;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -585,8 +588,8 @@ article[data-vim-selected].category-social {
|
|||||||
#suggestions,
|
#suggestions,
|
||||||
#infoboxes {
|
#infoboxes {
|
||||||
input {
|
input {
|
||||||
padding: 0;
|
padding: 3px;
|
||||||
margin: 3px;
|
margin: 0;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|||||||
59
searx/engines/cachy_os.py
Normal file
59
searx/engines/cachy_os.py
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""CachyOS (packages, it)"""
|
||||||
|
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
from datetime import datetime
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": 'https://cachyos.org',
|
||||||
|
"wikidata_id": "Q116777127",
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
|
||||||
|
base_url = "https://packages.cachyos.org/api/search"
|
||||||
|
categories = ['packages', 'it']
|
||||||
|
paging = True
|
||||||
|
results_per_page = 15
|
||||||
|
|
||||||
|
|
||||||
|
def request(query, params):
|
||||||
|
query_params = {
|
||||||
|
"search": query,
|
||||||
|
"page_size": results_per_page,
|
||||||
|
"current_page": params["pageno"],
|
||||||
|
}
|
||||||
|
|
||||||
|
params["url"] = f"{base_url}?{urlencode(query_params)}"
|
||||||
|
|
||||||
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp) -> EngineResults:
|
||||||
|
results = EngineResults()
|
||||||
|
search_res = resp.json()
|
||||||
|
|
||||||
|
for item in search_res["packages"]:
|
||||||
|
package_name = item["pkg_name"]
|
||||||
|
arch = item["pkg_arch"]
|
||||||
|
repo = item["repo_name"]
|
||||||
|
|
||||||
|
results.add(
|
||||||
|
results.types.LegacyResult(
|
||||||
|
{
|
||||||
|
"template": 'packages.html',
|
||||||
|
"url": f"https://packages.cachyos.org/package/{repo}/{arch}/{package_name}",
|
||||||
|
"title": f"{package_name} ({repo})",
|
||||||
|
"package_name": package_name,
|
||||||
|
"publishedDate": datetime.fromtimestamp(item["pkg_builddate"]),
|
||||||
|
"version": item["pkg_version"],
|
||||||
|
"content": item["pkg_desc"],
|
||||||
|
"tags": [arch],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return results
|
||||||
@@ -19,6 +19,8 @@ search_type = "web" # 'web', 'images', 'news'
|
|||||||
safesearch = True
|
safesearch = True
|
||||||
safesearch_map = {0: 'off', 1: 'moderate', 2: 'strict'}
|
safesearch_map = {0: 'off', 1: 'moderate', 2: 'strict'}
|
||||||
|
|
||||||
|
enable_http2 = False
|
||||||
|
|
||||||
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
args = {
|
args = {
|
||||||
@@ -30,6 +32,7 @@ def request(query, params):
|
|||||||
}
|
}
|
||||||
params['url'] = f"{base_url}/fs/2/search?{urlencode(args)}"
|
params['url'] = f"{base_url}/fs/2/search?{urlencode(args)}"
|
||||||
params['headers']['Referer'] = 'https://yep.com/'
|
params['headers']['Referer'] = 'https://yep.com/'
|
||||||
|
params['headers']['Origin'] = 'https://yep.com'
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -597,6 +597,11 @@ engines:
|
|||||||
# German videos have English subtitles.
|
# German videos have English subtitles.
|
||||||
disabled: true
|
disabled: true
|
||||||
|
|
||||||
|
- name: cachy os packages
|
||||||
|
engine: cachy_os
|
||||||
|
shortcut: cos
|
||||||
|
disabled: true
|
||||||
|
|
||||||
- name: chefkoch
|
- name: chefkoch
|
||||||
engine: chefkoch
|
engine: chefkoch
|
||||||
shortcut: chef
|
shortcut: chef
|
||||||
@@ -686,7 +691,7 @@ engines:
|
|||||||
shortcut: yep
|
shortcut: yep
|
||||||
categories: general
|
categories: general
|
||||||
search_type: web
|
search_type: web
|
||||||
timeout: 5
|
timeout: 15
|
||||||
disabled: true
|
disabled: true
|
||||||
|
|
||||||
- name: yep images
|
- name: yep images
|
||||||
|
|||||||
2
searx/static/themes/simple/sxng-ltr.min.css
vendored
2
searx/static/themes/simple/sxng-ltr.min.css
vendored
File diff suppressed because one or more lines are too long
2
searx/static/themes/simple/sxng-rtl.min.css
vendored
2
searx/static/themes/simple/sxng-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1,9 +1,9 @@
|
|||||||
<div id="suggestions" role="complementary" aria-labelledby="suggestions-title">
|
<div id="suggestions" role="complementary" aria-labelledby="suggestions-title">
|
||||||
<details class="sidebar-collapsible">
|
<details class="sidebar-collapsible">
|
||||||
<summary class="title" id="suggestions-title">{{ _('Suggestions') }}</summary>
|
<summary class="title" id="suggestions-title">{{ _('Suggestions') }}</summary>
|
||||||
<div class="wrapper">
|
<ul class="wrapper">
|
||||||
{%- for suggestion in suggestions -%}
|
{%- for suggestion in suggestions -%}
|
||||||
<form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
|
<li><form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
|
||||||
<input type="hidden" name="q" value="{{ suggestion.url }}">
|
<input type="hidden" name="q" value="{{ suggestion.url }}">
|
||||||
{%- for category in selected_categories -%}
|
{%- for category in selected_categories -%}
|
||||||
<input type="hidden" name="category_{{ category }}" value="1">
|
<input type="hidden" name="category_{{ category }}" value="1">
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
{%- if timeout_limit -%}
|
{%- if timeout_limit -%}
|
||||||
<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >
|
<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<input type="submit" class="suggestion" role="link" value="• {{ suggestion.title }}">
|
<input type="submit" class="suggestion" role="link" value="{{ suggestion.title }}">
|
||||||
</form>
|
</form></li>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</div>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user