mirror of
https://github.com/searxng/searxng.git
synced 2026-07-25 09:21: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 {
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
justify-content: flex-end;
|
||||
padding-left: 0;
|
||||
margin: 0;
|
||||
list-style-position: inside;
|
||||
|
||||
li::marker {
|
||||
color: var(--color-result-link-font);
|
||||
}
|
||||
|
||||
form {
|
||||
display: inline-block;
|
||||
flex: 1 1 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -585,8 +588,8 @@ article[data-vim-selected].category-social {
|
||||
#suggestions,
|
||||
#infoboxes {
|
||||
input {
|
||||
padding: 0;
|
||||
margin: 3px;
|
||||
padding: 3px;
|
||||
margin: 0;
|
||||
font-size: 0.9em;
|
||||
display: inline-block;
|
||||
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_map = {0: 'off', 1: 'moderate', 2: 'strict'}
|
||||
|
||||
enable_http2 = False
|
||||
|
||||
|
||||
def request(query, params):
|
||||
args = {
|
||||
@@ -30,6 +32,7 @@ def request(query, params):
|
||||
}
|
||||
params['url'] = f"{base_url}/fs/2/search?{urlencode(args)}"
|
||||
params['headers']['Referer'] = 'https://yep.com/'
|
||||
params['headers']['Origin'] = 'https://yep.com'
|
||||
return params
|
||||
|
||||
|
||||
|
||||
@@ -597,6 +597,11 @@ engines:
|
||||
# German videos have English subtitles.
|
||||
disabled: true
|
||||
|
||||
- name: cachy os packages
|
||||
engine: cachy_os
|
||||
shortcut: cos
|
||||
disabled: true
|
||||
|
||||
- name: chefkoch
|
||||
engine: chefkoch
|
||||
shortcut: chef
|
||||
@@ -686,7 +691,7 @@ engines:
|
||||
shortcut: yep
|
||||
categories: general
|
||||
search_type: web
|
||||
timeout: 5
|
||||
timeout: 15
|
||||
disabled: true
|
||||
|
||||
- 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">
|
||||
<details class="sidebar-collapsible">
|
||||
<summary class="title" id="suggestions-title">{{ _('Suggestions') }}</summary>
|
||||
<div class="wrapper">
|
||||
<ul class="wrapper">
|
||||
{%- 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 }}">
|
||||
{%- for category in selected_categories -%}
|
||||
<input type="hidden" name="category_{{ category }}" value="1">
|
||||
@@ -15,9 +15,9 @@
|
||||
{%- if timeout_limit -%}
|
||||
<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >
|
||||
{%- endif -%}
|
||||
<input type="submit" class="suggestion" role="link" value="• {{ suggestion.title }}">
|
||||
</form>
|
||||
<input type="submit" class="suggestion" role="link" value="{{ suggestion.title }}">
|
||||
</form></li>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
</ul>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user