mirror of
https://github.com/searxng/searxng.git
synced 2026-06-22 17:48:33 +02:00
Compare commits
56 Commits
a1490676e3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 952896d29e | |||
| 4cc32b2457 | |||
| cce0957f54 | |||
| 9375c0a6b6 | |||
| a702741e4e | |||
| aeced67249 | |||
| 199e03de1d | |||
| 9cd2439e5e | |||
| 9f4d8bca02 | |||
| de76a4a39b | |||
| a85a5e2794 | |||
| 92abd98a55 | |||
| 93e867c6b1 | |||
| 75c1b1dade | |||
| 097ab64c70 | |||
| 0e9f513efc | |||
| fd42d4fda1 | |||
| 5c38d2feab | |||
| 38b678c493 | |||
| fe1848673f | |||
| 8b10095e8a | |||
| b5ef7ec8f3 | |||
| bd73cc09ea | |||
| 4dfdc822cf | |||
| 502c820a25 | |||
| 4fb49b4498 | |||
| cf1410af8d | |||
| 6c9dcd4242 | |||
| b3e08f2a44 | |||
| a857041afc | |||
| 31a8a22aa6 | |||
| a29cda858c | |||
| 2e10a2f614 | |||
| 2100eb04e1 | |||
| c58391d673 | |||
| c3284c8238 | |||
| 290d3e0c6a | |||
| 0608dfa4d1 | |||
| 1184b3212f | |||
| 65e0e4c069 | |||
| d14fa1f6e2 | |||
| 2d248704fa | |||
| 3096b1218f | |||
| 82a8a90230 | |||
| e3d4fbe570 | |||
| 031747f29e | |||
| e3bd7f5df1 | |||
| b48205b384 | |||
| 8522638b00 | |||
| ab81c77533 | |||
| cc196f2a5b | |||
| dd3022d680 | |||
| de8a3de15a | |||
| 4dd0bf4867 | |||
| 1957876dd6 | |||
| ab13451086 |
@@ -1,5 +1,6 @@
|
|||||||
*
|
*
|
||||||
|
|
||||||
|
!container/*.template.*
|
||||||
!container/entrypoint.sh
|
!container/entrypoint.sh
|
||||||
!searx/**
|
!searx/**
|
||||||
!requirements*.txt
|
!requirements*.txt
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
python-version: "${{ env.PYTHON_VERSION }}"
|
python-version: "${{ env.PYTHON_VERSION }}"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
fetch-depth: "0"
|
fetch-depth: "0"
|
||||||
@@ -141,7 +141,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
python-version: "${{ env.PYTHON_VERSION }}"
|
python-version: "${{ env.PYTHON_VERSION }}"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
python-version: "${{ env.PYTHON_VERSION }}"
|
python-version: "${{ env.PYTHON_VERSION }}"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
fetch-depth: "0"
|
fetch-depth: "0"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
python-version: "${{ matrix.python-version }}"
|
python-version: "${{ matrix.python-version }}"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
python-version: "${{ env.PYTHON_VERSION }}"
|
python-version: "${{ env.PYTHON_VERSION }}"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
python-version: "${{ env.PYTHON_VERSION }}"
|
python-version: "${{ env.PYTHON_VERSION }}"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.WEBLATE_GITHUB_TOKEN }}"
|
token: "${{ secrets.WEBLATE_GITHUB_TOKEN }}"
|
||||||
fetch-depth: "0"
|
fetch-depth: "0"
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
python-version: "${{ env.PYTHON_VERSION }}"
|
python-version: "${{ env.PYTHON_VERSION }}"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.WEBLATE_GITHUB_TOKEN }}"
|
token: "${{ secrets.WEBLATE_GITHUB_TOKEN }}"
|
||||||
fetch-depth: "0"
|
fetch-depth: "0"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: "false"
|
persist-credentials: "false"
|
||||||
|
|
||||||
|
|||||||
+15
-29
@@ -2,12 +2,12 @@
|
|||||||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
||||||
"files": {
|
"files": {
|
||||||
"ignoreUnknown": true,
|
"ignoreUnknown": true,
|
||||||
"includes": ["**", "!node_modules"]
|
"includes": ["**", "!node_modules", "!src/brand", "!src/svg"]
|
||||||
},
|
},
|
||||||
"assist": {
|
"assist": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"actions": {
|
"actions": {
|
||||||
"recommended": true,
|
"preset": "recommended",
|
||||||
"source": {
|
"source": {
|
||||||
"useSortedAttributes": "on",
|
"useSortedAttributes": "on",
|
||||||
"useSortedProperties": "on"
|
"useSortedProperties": "on"
|
||||||
@@ -27,12 +27,14 @@
|
|||||||
"linter": {
|
"linter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true,
|
"preset": "recommended",
|
||||||
"complexity": {
|
"complexity": {
|
||||||
"noForEach": "error",
|
"noForEach": "error",
|
||||||
"noImplicitCoercions": "error",
|
"noImplicitCoercions": "error",
|
||||||
|
"noRedundantDefaultExport": "error",
|
||||||
"noUselessCatchBinding": "error",
|
"noUselessCatchBinding": "error",
|
||||||
"noUselessUndefined": "error",
|
"noUselessUndefined": "error",
|
||||||
|
"useArrayFind": "error",
|
||||||
"useSimplifiedLogicExpression": "error"
|
"useSimplifiedLogicExpression": "error"
|
||||||
},
|
},
|
||||||
"correctness": {
|
"correctness": {
|
||||||
@@ -42,25 +44,11 @@
|
|||||||
"useSingleJsDocAsterisk": "error"
|
"useSingleJsDocAsterisk": "error"
|
||||||
},
|
},
|
||||||
"nursery": {
|
"nursery": {
|
||||||
"noContinue": "warn",
|
|
||||||
"noEqualsToNull": "warn",
|
|
||||||
"noFloatingPromises": "warn",
|
"noFloatingPromises": "warn",
|
||||||
"noForIn": "warn",
|
|
||||||
"noIncrementDecrement": "warn",
|
|
||||||
"noMisusedPromises": "warn",
|
"noMisusedPromises": "warn",
|
||||||
"noMultiAssign": "warn",
|
|
||||||
"noMultiStr": "warn",
|
|
||||||
"noNestedPromises": "warn",
|
|
||||||
"noParametersOnlyUsedInRecursion": "warn",
|
|
||||||
"noRedundantDefaultExport": "warn",
|
|
||||||
"noReturnAssign": "warn",
|
|
||||||
"noUselessReturn": "off",
|
|
||||||
"useAwaitThenable": "off",
|
"useAwaitThenable": "off",
|
||||||
"useConsistentEnumValueType": "warn",
|
|
||||||
"useDestructuring": "warn",
|
|
||||||
"useExhaustiveSwitchCases": "warn",
|
"useExhaustiveSwitchCases": "warn",
|
||||||
"useExplicitType": "off",
|
"useExplicitType": "off",
|
||||||
"useFind": "warn",
|
|
||||||
"useRegexpExec": "warn"
|
"useRegexpExec": "warn"
|
||||||
},
|
},
|
||||||
"performance": {
|
"performance": {
|
||||||
@@ -75,23 +63,15 @@
|
|||||||
"noCommonJs": "error",
|
"noCommonJs": "error",
|
||||||
"noEnum": "error",
|
"noEnum": "error",
|
||||||
"noImplicitBoolean": "error",
|
"noImplicitBoolean": "error",
|
||||||
|
"noIncrementDecrement": "error",
|
||||||
"noInferrableTypes": "error",
|
"noInferrableTypes": "error",
|
||||||
|
"noMultiAssign": "error",
|
||||||
|
"noMultilineString": "error",
|
||||||
"noNamespace": "error",
|
"noNamespace": "error",
|
||||||
"noNegationElse": "error",
|
"noNegationElse": "error",
|
||||||
"noNestedTernary": "error",
|
"noNestedTernary": "error",
|
||||||
"noParameterAssign": "error",
|
"noParameterAssign": "error",
|
||||||
"noParameterProperties": "error",
|
"noParameterProperties": "error",
|
||||||
"noRestrictedTypes": {
|
|
||||||
"level": "error",
|
|
||||||
"options": {
|
|
||||||
"types": {
|
|
||||||
"Element": {
|
|
||||||
"message": "Element is too generic",
|
|
||||||
"use": "HTMLElement"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"noSubstr": "error",
|
"noSubstr": "error",
|
||||||
"noUnusedTemplateLiteral": "error",
|
"noUnusedTemplateLiteral": "error",
|
||||||
"noUselessElse": "error",
|
"noUselessElse": "error",
|
||||||
@@ -107,6 +87,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"useConsistentBuiltinInstantiation": "error",
|
"useConsistentBuiltinInstantiation": "error",
|
||||||
|
"useConsistentEnumValueType": "error",
|
||||||
"useConsistentMemberAccessibility": {
|
"useConsistentMemberAccessibility": {
|
||||||
"level": "error",
|
"level": "error",
|
||||||
"options": {
|
"options": {
|
||||||
@@ -126,6 +107,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"useDefaultSwitchClause": "error",
|
"useDefaultSwitchClause": "error",
|
||||||
|
"useDestructuring": "error",
|
||||||
"useExplicitLengthCheck": "error",
|
"useExplicitLengthCheck": "error",
|
||||||
"useForOf": "error",
|
"useForOf": "error",
|
||||||
"useGroupedAccessorPairs": "error",
|
"useGroupedAccessorPairs": "error",
|
||||||
@@ -142,13 +124,17 @@
|
|||||||
"useUnifiedTypeSignatures": "error"
|
"useUnifiedTypeSignatures": "error"
|
||||||
},
|
},
|
||||||
"suspicious": {
|
"suspicious": {
|
||||||
"noAlert": "error",
|
|
||||||
"noBitwiseOperators": "error",
|
"noBitwiseOperators": "error",
|
||||||
"noConstantBinaryExpressions": "error",
|
"noConstantBinaryExpressions": "error",
|
||||||
"noDeprecatedImports": "error",
|
"noDeprecatedImports": "error",
|
||||||
"noEmptyBlockStatements": "error",
|
"noEmptyBlockStatements": "error",
|
||||||
|
"noEqualsToNull": "error",
|
||||||
"noEvolvingTypes": "error",
|
"noEvolvingTypes": "error",
|
||||||
|
"noForIn": "error",
|
||||||
"noImportCycles": "error",
|
"noImportCycles": "error",
|
||||||
|
"noNestedPromises": "error",
|
||||||
|
"noParametersOnlyUsedInRecursion": "error",
|
||||||
|
"noReturnAssign": "error",
|
||||||
"noUnassignedVariables": "error",
|
"noUnassignedVariables": "error",
|
||||||
"noVar": "error",
|
"noVar": "error",
|
||||||
"useNumberToFixedDigitsArgument": "error",
|
"useNumberToFixedDigitsArgument": "error",
|
||||||
|
|||||||
Generated
+257
-232
@@ -15,16 +15,16 @@
|
|||||||
"swiped-events": "1.2.0"
|
"swiped-events": "1.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.4.16",
|
"@biomejs/biome": "2.5.0",
|
||||||
"@types/node": "^25.9.1",
|
"@types/node": "^26.0.0",
|
||||||
"browserslist": "^4.28.2",
|
"browserslist": "^4.28.2",
|
||||||
"browserslist-to-esbuild": "^2.1.1",
|
"browserslist-to-esbuild": "^2.1.1",
|
||||||
"edge.js": "^6.5.1",
|
"edge.js": "^6.5.1",
|
||||||
"less": "^4.6.4",
|
"less": "^4.6.6",
|
||||||
"mathjs": "^15.2.0",
|
"mathjs": "^15.2.0",
|
||||||
"sharp": "~0.34.5",
|
"sharp": "~0.35.1",
|
||||||
"sort-package-json": "^3.6.1",
|
"sort-package-json": "^4.0.0",
|
||||||
"stylelint": "^17.12.0",
|
"stylelint": "^17.13.0",
|
||||||
"stylelint-config-standard-less": "^4.1.0",
|
"stylelint-config-standard-less": "^4.1.0",
|
||||||
"stylelint-prettier": "^5.0.3",
|
"stylelint-prettier": "^5.0.3",
|
||||||
"svgo": "^4.0.1",
|
"svgo": "^4.0.1",
|
||||||
@@ -69,9 +69,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/biome": {
|
"node_modules/@biomejs/biome": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.0.tgz",
|
||||||
"integrity": "sha512-x9ajFh1zChVybCiM3TN6OD4phAqLgtPZjFrZF+aTMYCPjwBO+k529TX7PPsAqtGNLeV4UgzwQnowEgS7bGmzcA==",
|
"integrity": "sha512-4kURkd9hAPrdDM3C9n82ycYgx8hvQcW6MjKTEejruj8rK0N8P3OPpdy8BvI8kt3KWY4ycF5XtDOrktetEfhfuw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT OR Apache-2.0",
|
"license": "MIT OR Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -85,20 +85,20 @@
|
|||||||
"url": "https://opencollective.com/biome"
|
"url": "https://opencollective.com/biome"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@biomejs/cli-darwin-arm64": "2.4.16",
|
"@biomejs/cli-darwin-arm64": "2.5.0",
|
||||||
"@biomejs/cli-darwin-x64": "2.4.16",
|
"@biomejs/cli-darwin-x64": "2.5.0",
|
||||||
"@biomejs/cli-linux-arm64": "2.4.16",
|
"@biomejs/cli-linux-arm64": "2.5.0",
|
||||||
"@biomejs/cli-linux-arm64-musl": "2.4.16",
|
"@biomejs/cli-linux-arm64-musl": "2.5.0",
|
||||||
"@biomejs/cli-linux-x64": "2.4.16",
|
"@biomejs/cli-linux-x64": "2.5.0",
|
||||||
"@biomejs/cli-linux-x64-musl": "2.4.16",
|
"@biomejs/cli-linux-x64-musl": "2.5.0",
|
||||||
"@biomejs/cli-win32-arm64": "2.4.16",
|
"@biomejs/cli-win32-arm64": "2.5.0",
|
||||||
"@biomejs/cli-win32-x64": "2.4.16"
|
"@biomejs/cli-win32-x64": "2.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.0.tgz",
|
||||||
"integrity": "sha512-wxPvu4XOA85YJk9ixSWUmq/QBHbid85BISbOAqqBM/5xQpPk9ayjk5375tOlSC0BeCwNSbPFafQBm+vBumXq0A==",
|
"integrity": "sha512-Mn3Fwi3SA5fgmfCPqmzpWF2DLZnms3BVAhM088nTnGrTZmHS3wwIjcoZPqpXeNgd3DrrLH6xp8vTLIBuJoZiXw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -113,9 +113,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-darwin-x64": {
|
"node_modules/@biomejs/cli-darwin-x64": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.0.tgz",
|
||||||
"integrity": "sha512-xFCqGPwYusQJp4N4NJLi1XJiZqjwFdjhT+KqtNy+Ug3qgfczqnTa6MSDvxJF6TkuDLoYJItMapz6tAf7kCekFw==",
|
"integrity": "sha512-rg3VPL5P8mYro6pqlXYXuJWph21slVp3SZtAqWSrkZs40d2gTzYmHF8E/X1iTID25btmNKltNDJ926sqVBp7DQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -130,9 +130,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-arm64": {
|
"node_modules/@biomejs/cli-linux-arm64": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.0.tgz",
|
||||||
"integrity": "sha512-2kFb4//jxfZaP6D+Rj5VkHkxgyD9EoRAVBEQb8PKRv+s4NO2zYNJKXFaJmK1CmhufJOWEfpHKaRbOja7qjmdhQ==",
|
"integrity": "sha512-tl+LW8fdD96/xdeWtWwc82LIOc5CoY7N2AsogLTp5R4ECErYt+8Jl/N68ezN9vzSiqPTxw6vjcihoLPYKZHrlw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -147,9 +147,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.0.tgz",
|
||||||
"integrity": "sha512-oYxnW0ARfJkr72ezzF2OR8N/rtkgLUQeYtF8cFhVswbknHxtTcmzSsanVJP8yQKnGpGpc2ck6c5zLvHahL6Cbg==",
|
"integrity": "sha512-vQdM4oSGaf7ZNeGO9w5+Y8SBtyser9M6znxYbm7Ec8wInxJu1WiKxFYZW5Auj2d80bcVvefuGGRxoFOE0eee8g==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -164,9 +164,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-x64": {
|
"node_modules/@biomejs/cli-linux-x64": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.0.tgz",
|
||||||
"integrity": "sha512-NbcBbi/nJqn5baae6wqRXdS7Gadf2uRpehSh6vMSYpG8OhkXl/Xg8aorWrJ+9VWqAT5ml90alLvorkpMW0nBwQ==",
|
"integrity": "sha512-zpEGf4RQbFEh8Vt7OmavLyyOzRbtcE9osCqrS1kfvt8jDvxwhKXLSf7n0ebr/ov0RJ9ssP+lhs6C8a9WwFvrQA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -181,9 +181,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.0.tgz",
|
||||||
"integrity": "sha512-iHDS+MCM65DPqWGu+ECC3uoALyj2H7F4nVUPxIPjz/PIl94EUu+EDfGZDzFP+NY1EOPVt9NQvwFqq7HdMmowdg==",
|
"integrity": "sha512-+9hIcMngJ+yGUahXqZuZ8CoWKJE9SAZsFsM3QDvXpNsLbXZ9lqVzgBhOk/jTSYkOA0GLP9eu3teukqpLUojHMg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -198,9 +198,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-win32-arm64": {
|
"node_modules/@biomejs/cli-win32-arm64": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.0.tgz",
|
||||||
"integrity": "sha512-0rgImMsNb5v/chhkIFe3wu7PEFClS6RBAYUijGL9UsYN3PanSaoK24HSSuSJb1pYbYYVjzAyZTl3gtjJ84BM8A==",
|
"integrity": "sha512-jB0wAvTLI4itx5VidqVUejPQFhRUxiZ9l9FvZ26D5fl6t3qme+ZB4PD3bTSeL1vZ8NI2Rx/zj6H9zcESuGHKGw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -215,9 +215,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-win32-x64": {
|
"node_modules/@biomejs/cli-win32-x64": {
|
||||||
"version": "2.4.16",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.0.tgz",
|
||||||
"integrity": "sha512-Kp85jgoBHa05gix6UIRjfCDiUV3w/8VIdZ247VyyO2gEjaw12WEVhdIjlxp/AMzXxqxQwbxNTDVZ3Mwd2RG5rw==",
|
"integrity": "sha512-VT/lF+GId+67j8aDfLkxdxNoVApsPSTbyAtB3jJq0IWTrY77WXfbPfpngxq0bA6JCEv/7k8C9qWjDRKRznDlyw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -256,9 +256,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@csstools/css-calc": {
|
"node_modules/@csstools/css-calc": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.2.1.tgz",
|
||||||
"integrity": "sha512-bR9e6o2BDB12jzN/gIbjHa5wLJ4UjD1CB9pM7ehlc0ddk6EBz+yYS1EV2MF55/HUxrHcB/hehAyt5vhsA3hx7w==",
|
"integrity": "sha512-DtdHlgXh5ZkA43cwBcAm+huzgJiwx3ZTWVjBs94kwz2xKqSimDA3lBgCjphYgwgVUMWatSM0pDd8TILB1yrVVg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -303,9 +303,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@csstools/css-syntax-patches-for-csstree": {
|
"node_modules/@csstools/css-syntax-patches-for-csstree": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.5.tgz",
|
||||||
"integrity": "sha512-SH60bMfrRCJF3morcdk57WklujF4Jr/EsQUzqkarfHXEFcAR1gg7fS/chAE922Sehgzc1/+Tz5H3Ypa1HiEKrg==",
|
"integrity": "sha512-oNjBvzLq2GPZtJphCjLqXow/cHySHSgtxvKZb7OqSZ/xHgw6NWNhfad+6AB9cLeVm6eA9d/qMll3JdEHjy6M+A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -462,9 +462,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-darwin-arm64": {
|
"node_modules/@img/sharp-darwin-arm64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.1.tgz",
|
||||||
"integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",
|
"integrity": "sha512-T15JRWOubQ3f5+GxnWeIvo47u5qV0M9HBgJhT+f2gE1e9e6OhR6K73Re52Hm80qWcu1DNb3GweKmpr/MnuP2Ow==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -475,19 +475,19 @@
|
|||||||
"darwin"
|
"darwin"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-darwin-arm64": "1.2.4"
|
"@img/sharp-libvips-darwin-arm64": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-darwin-x64": {
|
"node_modules/@img/sharp-darwin-x64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.1.tgz",
|
||||||
"integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",
|
"integrity": "sha512-t1CPD0cr7XCHjwUj6tQ5MC0pCi866I+gUW6zbUX4aFPnKd1DFBtk0M+gWcjX8VeEzgfCNiSiNTVFZ6b7kvdbnQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -498,19 +498,39 @@
|
|||||||
"darwin"
|
"darwin"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-darwin-x64": "1.2.4"
|
"@img/sharp-libvips-darwin-x64": "1.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@img/sharp-freebsd-wasm32": {
|
||||||
|
"version": "0.35.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.1.tgz",
|
||||||
|
"integrity": "sha512-MBSQXqNPThW9EcZ905H6N4sEdX5EwZEYzGx5EBq9ncDCGJALMiY1xPFJxNdzuB1iBjLOpIfxajM6YxdvwmQSLA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"@img/sharp-wasm32": "0.35.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.9.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://opencollective.com/libvips"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-darwin-arm64": {
|
"node_modules/@img/sharp-libvips-darwin-arm64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.0.tgz",
|
||||||
"integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",
|
"integrity": "sha512-EKbmBKtyTH+GPFDRw2TgK2oV6hyxxlJVIar4hoTYSNmIwipgMFdxPQqR392GmfdsPGWga0mCFN1cCKjRb9cljw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -525,9 +545,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-darwin-x64": {
|
"node_modules/@img/sharp-libvips-darwin-x64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.0.tgz",
|
||||||
"integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",
|
"integrity": "sha512-Pl2OmOvrJ42adUllESxBsG54PfXLo1OYg9i3c5/5Ln/qJ0gZuTM9YMhQJPIbXqwidLRc/c2zuHt4RsrymmNv7A==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -542,9 +562,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linux-arm": {
|
"node_modules/@img/sharp-libvips-linux-arm": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.0.tgz",
|
||||||
"integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",
|
"integrity": "sha512-A8UpHoUDW4DwnXoV6+q3C1s7QLRAHtPDEjWuNZjwHMyoCNZnm0GeNN8ls9f/bsEYTRQRW96C/n34XJQHJ2fT7A==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@@ -559,9 +579,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linux-arm64": {
|
"node_modules/@img/sharp-libvips-linux-arm64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.0.tgz",
|
||||||
"integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",
|
"integrity": "sha512-C0SqjoFKnszqa44EQ7xoaT48nnO0lOyXEULfXMWi8krrjOPGYkeK30Okzla6ATbBYsyZ0ySinK0FVkpv3DwzfQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -576,9 +596,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linux-ppc64": {
|
"node_modules/@img/sharp-libvips-linux-ppc64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.0.tgz",
|
||||||
"integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",
|
"integrity": "sha512-WOpkVxAjFd369iaIzEgNRreFD+gWdUMIGD5zplhNKNeqS6mm5dac3q2AFyCBmzYoAdouzZvRBgxy4z8QHZb4/A==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
@@ -593,9 +613,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linux-riscv64": {
|
"node_modules/@img/sharp-libvips-linux-riscv64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.0.tgz",
|
||||||
"integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",
|
"integrity": "sha512-DRWw0mOHusrCCuw2rqP87oLg6PGlkomVDFqw2hIwsSfwWpu4k3XLcBPaKKl6ct/GtL/cwNkgwjV/tc0Mqht3VA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
@@ -610,9 +630,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linux-s390x": {
|
"node_modules/@img/sharp-libvips-linux-s390x": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.0.tgz",
|
||||||
"integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",
|
"integrity": "sha512-9APy+nFWhHS+kzLgWZfLcyrUd7YqnAQVa4BPOo4xkoHpdoktOAPG4cEr9+Jpl0TtqfVmcMJimNL5qNTyyOHZNA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
@@ -627,9 +647,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linux-x64": {
|
"node_modules/@img/sharp-libvips-linux-x64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.0.tgz",
|
||||||
"integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",
|
"integrity": "sha512-y9RNUYDe2A1UAdhLyfeOodGRszQdaEoe4nfOpp/sNVPl2CWIcUyFaDoCh4vPLPxu19803j2naLqZup2WxDXCLA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -644,9 +664,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linuxmusl-arm64": {
|
"node_modules/@img/sharp-libvips-linuxmusl-arm64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.0.tgz",
|
||||||
"integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",
|
"integrity": "sha512-cC1wkC0Mlucd0KSiGrLkJnB/ZqPvZCntc/Lk7ZnYO5ZSbF2euNek4Xvxafojq+wN1q/W0eprdpUIjUr/EV2PBg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -661,9 +681,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-libvips-linuxmusl-x64": {
|
"node_modules/@img/sharp-libvips-linuxmusl-x64": {
|
||||||
"version": "1.2.4",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.0.tgz",
|
||||||
"integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",
|
"integrity": "sha512-LiYMhUZicB1QG//+RvmYZpXJO8fYRENfp+MZUCnG9aw+AKvGAy9gPaCnuwsPcBFs8EV66M0NNxj9VHcNklE8zw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -678,9 +698,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linux-arm": {
|
"node_modules/@img/sharp-linux-arm": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.1.tgz",
|
||||||
"integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",
|
"integrity": "sha512-jygmR02PpCYypt7xB7nst1vqjZp/BpRA/Kf9nK7qRponJ/KrLPaZWEG4G15z1d2FZ6XqI+T0350ha3RSnKx24A==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@@ -691,19 +711,19 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-arm": "1.2.4"
|
"@img/sharp-libvips-linux-arm": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linux-arm64": {
|
"node_modules/@img/sharp-linux-arm64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.1.tgz",
|
||||||
"integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",
|
"integrity": "sha512-ErCRyGU7LeoaFBZ0xW8hhLlXzhAg80sc4vxePB86qvtEvW1jEhhmbiNBP4oEzZfPMnu6HwHXfzD2W2kBU+RnCw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -714,19 +734,19 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-arm64": "1.2.4"
|
"@img/sharp-libvips-linux-arm64": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linux-ppc64": {
|
"node_modules/@img/sharp-linux-ppc64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.1.tgz",
|
||||||
"integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",
|
"integrity": "sha512-LUWZ2+r2UoLCd8j0RLCwQ4gL6w47+Y7igxtVnPIDXOOEjV86LpBkAHq5VpJeg+GHbw0KN/JWlPJOdZjyZnFqFQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
@@ -737,19 +757,19 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-ppc64": "1.2.4"
|
"@img/sharp-libvips-linux-ppc64": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linux-riscv64": {
|
"node_modules/@img/sharp-linux-riscv64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.1.tgz",
|
||||||
"integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",
|
"integrity": "sha512-i7x6J3mwF4JgT0sM4V4WlAWdJ0bucPtA9rzO1bTji1n5qgBq/W5nn87RvOQPleuuxahNoLdTngByD8/vDDLArw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
@@ -760,19 +780,19 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-riscv64": "1.2.4"
|
"@img/sharp-libvips-linux-riscv64": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linux-s390x": {
|
"node_modules/@img/sharp-linux-s390x": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.1.tgz",
|
||||||
"integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",
|
"integrity": "sha512-0zSaTUjTF0kIWTSYxD4EG/nvCU4jez53+3RdURtoY3HvbXtIQ98W90JnrGz/oLRFuEnfIy9+7xeq883euc0ZWw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
@@ -783,19 +803,19 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-s390x": "1.2.4"
|
"@img/sharp-libvips-linux-s390x": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linux-x64": {
|
"node_modules/@img/sharp-linux-x64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.1.tgz",
|
||||||
"integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",
|
"integrity": "sha512-NbJD4mWdeyrNQKluO/tR/wBDOelcowSVGNBWxI0e3ZtlXc6F/UOVKDj1MLD4zl3oHTuvKW3s+MA9N54YTldAYw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -806,19 +826,19 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linux-x64": "1.2.4"
|
"@img/sharp-libvips-linux-x64": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linuxmusl-arm64": {
|
"node_modules/@img/sharp-linuxmusl-arm64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.1.tgz",
|
||||||
"integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",
|
"integrity": "sha512-VoW2sQCWI+0YIKQEmWJ8vzaQjTg9wIyfkFpvEfAS2h43X6iHu7GTk1hhOgB4IpSzCHe8UwQZIcx7b81VTaOrJA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -829,19 +849,19 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
|
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-linuxmusl-x64": {
|
"node_modules/@img/sharp-linuxmusl-x64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.1.tgz",
|
||||||
"integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",
|
"integrity": "sha512-LjBoSd/c5JU0/K5MwzDMlgsSRP2bPn98JQGFFQAOLQ0bU/1z4ekxUdSKY9BmlwSh/cA+OrvpgsWqfZyYfVHBRw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -852,39 +872,67 @@
|
|||||||
"linux"
|
"linux"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-libvips-linuxmusl-x64": "1.2.4"
|
"@img/sharp-libvips-linuxmusl-x64": "1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-wasm32": {
|
"node_modules/@img/sharp-wasm32": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.1.tgz",
|
||||||
"integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",
|
"integrity": "sha512-PCQUoQdZyE8tp3HpbevuihfUmgSP4qWI0FGEPWoeXqaS+cUrFfemabHQiebUmUmlUhCuNnQMxGrQ+CPqK4hnxg==",
|
||||||
"cpu": [
|
|
||||||
"wasm32"
|
|
||||||
],
|
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
|
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emnapi/runtime": "^1.7.0"
|
"@emnapi/runtime": "^1.11.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://opencollective.com/libvips"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@img/sharp-wasm32/node_modules/@emnapi/runtime": {
|
||||||
|
"version": "1.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.0.tgz",
|
||||||
|
"integrity": "sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@img/sharp-webcontainers-wasm32": {
|
||||||
|
"version": "0.35.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.1.tgz",
|
||||||
|
"integrity": "sha512-xU2ml2bU2OPxYVvW2A6ae4M1g5QKyhKG06P4FAt+YEaFQQO0919Qx+XxIZEUuWTMoDViLpMws2/dQwoe/VcA6A==",
|
||||||
|
"cpu": [
|
||||||
|
"wasm32"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"optional": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@img/sharp-wasm32": "0.35.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-win32-arm64": {
|
"node_modules/@img/sharp-win32-arm64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.1.tgz",
|
||||||
"integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",
|
"integrity": "sha512-IkmHwuFhYpd3bTsN5SAahjwhiAcyXPooBt8vEUgxY3T0IP70sSJ0nU1xiPzZY8AH/OB1XpV3j8aZSVSOSfTbdA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -895,16 +943,16 @@
|
|||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-win32-ia32": {
|
"node_modules/@img/sharp-win32-ia32": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.1.tgz",
|
||||||
"integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",
|
"integrity": "sha512-wQahqCi9MD8Yxzg4gVM4fNrZxh+r6vD55PyIg+WJPaM5ZRUyF35iQpwJCuma3r6viU9/8Pxlc+XHV+woVa6nCQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
@@ -915,16 +963,16 @@
|
|||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": "^20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@img/sharp-win32-x64": {
|
"node_modules/@img/sharp-win32-x64": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.1.tgz",
|
||||||
"integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",
|
"integrity": "sha512-WzBtkYtZHATLPe8XRharxZXxQ9cdLrQWHiwxt+BJ5rBsisQrKeeV86ErxPSVhcG6xCEuNhs0SqLpWr7XDa2k6w==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -935,7 +983,7 @@
|
|||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
@@ -1522,13 +1570,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "25.9.1",
|
"version": "26.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.0.0.tgz",
|
||||||
"integrity": "sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg==",
|
"integrity": "sha512-vf2YFi1iY9lHGwNJMs01biZFbKJkrZR1T6/MlzjhJLPdntOHLhTrDSnSVcdtvjihi4VQNlrFRIxLsDBlQpAipA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": ">=7.24.0 <7.24.7"
|
"undici-types": "~8.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/pluralize": {
|
"node_modules/@types/pluralize": {
|
||||||
@@ -2842,9 +2890,9 @@
|
|||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
},
|
},
|
||||||
"node_modules/less": {
|
"node_modules/less": {
|
||||||
"version": "4.6.4",
|
"version": "4.6.6",
|
||||||
"resolved": "https://registry.npmjs.org/less/-/less-4.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/less/-/less-4.6.6.tgz",
|
||||||
"integrity": "sha512-OJmO5+HxZLLw0RLzkqaNHzcgEAQG7C0y3aMbwtCzIUFZsLMNNq/1IdAdHEycQ58CwUO3jPTHmoN+tE5I7FQxNg==",
|
"integrity": "sha512-ooPSwQGQ2sVe8Dh1jVsbKKsRR2gd8lFK72BDkeSzjnD1T5aIHL65hCMfO0GVmtriKgDKrQv6xp9UrihUsWuAzA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2861,7 +2909,7 @@
|
|||||||
"errno": "^0.1.1",
|
"errno": "^0.1.1",
|
||||||
"graceful-fs": "^4.1.2",
|
"graceful-fs": "^4.1.2",
|
||||||
"image-size": "~0.5.0",
|
"image-size": "~0.5.0",
|
||||||
"make-dir": "^2.1.0",
|
"make-dir": "^5.1.0",
|
||||||
"mime": "^1.4.1",
|
"mime": "^1.4.1",
|
||||||
"needle": "^3.1.0",
|
"needle": "^3.1.0",
|
||||||
"source-map": "~0.6.0"
|
"source-map": "~0.6.0"
|
||||||
@@ -3143,18 +3191,17 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/make-dir": {
|
"node_modules/make-dir": {
|
||||||
"version": "2.1.0",
|
"version": "5.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-5.1.0.tgz",
|
||||||
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
|
"integrity": "sha512-IfpFq6UM39dUNiphpA6uDezNx/AvWyhwfICWPR3t1VspkgkMZrL+Rk1RbN1bx+aeNYwOrqGJgEgV3yotk+ZUVw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
|
||||||
"pify": "^4.0.1",
|
|
||||||
"semver": "^5.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mathjs": {
|
"node_modules/mathjs": {
|
||||||
@@ -3443,17 +3490,6 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/pify": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/pluralize": {
|
"node_modules/pluralize": {
|
||||||
"version": "8.0.0",
|
"version": "8.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
|
||||||
@@ -3813,66 +3849,55 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
|
||||||
"version": "5.7.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
|
||||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"optional": true,
|
|
||||||
"bin": {
|
|
||||||
"semver": "bin/semver"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/sharp": {
|
"node_modules/sharp": {
|
||||||
"version": "0.34.5",
|
"version": "0.35.1",
|
||||||
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz",
|
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.1.tgz",
|
||||||
"integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==",
|
"integrity": "sha512-lW979AMi+ESidzMv/Lnv+F9bknzLyxLqFI05Sm433vOeRcltgxQmXpnfOOFIAlKtwXU/ksupm2srQoFCkR214g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@img/colour": "^1.0.0",
|
"@img/colour": "^1.1.0",
|
||||||
"detect-libc": "^2.1.2",
|
"detect-libc": "^2.1.2",
|
||||||
"semver": "^7.7.3"
|
"semver": "^7.8.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
"node": ">=20.9.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-darwin-arm64": "0.34.5",
|
"@img/sharp-darwin-arm64": "0.35.1",
|
||||||
"@img/sharp-darwin-x64": "0.34.5",
|
"@img/sharp-darwin-x64": "0.35.1",
|
||||||
"@img/sharp-libvips-darwin-arm64": "1.2.4",
|
"@img/sharp-freebsd-wasm32": "0.35.1",
|
||||||
"@img/sharp-libvips-darwin-x64": "1.2.4",
|
"@img/sharp-libvips-darwin-arm64": "1.3.0",
|
||||||
"@img/sharp-libvips-linux-arm": "1.2.4",
|
"@img/sharp-libvips-darwin-x64": "1.3.0",
|
||||||
"@img/sharp-libvips-linux-arm64": "1.2.4",
|
"@img/sharp-libvips-linux-arm": "1.3.0",
|
||||||
"@img/sharp-libvips-linux-ppc64": "1.2.4",
|
"@img/sharp-libvips-linux-arm64": "1.3.0",
|
||||||
"@img/sharp-libvips-linux-riscv64": "1.2.4",
|
"@img/sharp-libvips-linux-ppc64": "1.3.0",
|
||||||
"@img/sharp-libvips-linux-s390x": "1.2.4",
|
"@img/sharp-libvips-linux-riscv64": "1.3.0",
|
||||||
"@img/sharp-libvips-linux-x64": "1.2.4",
|
"@img/sharp-libvips-linux-s390x": "1.3.0",
|
||||||
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4",
|
"@img/sharp-libvips-linux-x64": "1.3.0",
|
||||||
"@img/sharp-libvips-linuxmusl-x64": "1.2.4",
|
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0",
|
||||||
"@img/sharp-linux-arm": "0.34.5",
|
"@img/sharp-libvips-linuxmusl-x64": "1.3.0",
|
||||||
"@img/sharp-linux-arm64": "0.34.5",
|
"@img/sharp-linux-arm": "0.35.1",
|
||||||
"@img/sharp-linux-ppc64": "0.34.5",
|
"@img/sharp-linux-arm64": "0.35.1",
|
||||||
"@img/sharp-linux-riscv64": "0.34.5",
|
"@img/sharp-linux-ppc64": "0.35.1",
|
||||||
"@img/sharp-linux-s390x": "0.34.5",
|
"@img/sharp-linux-riscv64": "0.35.1",
|
||||||
"@img/sharp-linux-x64": "0.34.5",
|
"@img/sharp-linux-s390x": "0.35.1",
|
||||||
"@img/sharp-linuxmusl-arm64": "0.34.5",
|
"@img/sharp-linux-x64": "0.35.1",
|
||||||
"@img/sharp-linuxmusl-x64": "0.34.5",
|
"@img/sharp-linuxmusl-arm64": "0.35.1",
|
||||||
"@img/sharp-wasm32": "0.34.5",
|
"@img/sharp-linuxmusl-x64": "0.35.1",
|
||||||
"@img/sharp-win32-arm64": "0.34.5",
|
"@img/sharp-webcontainers-wasm32": "0.35.1",
|
||||||
"@img/sharp-win32-ia32": "0.34.5",
|
"@img/sharp-win32-arm64": "0.35.1",
|
||||||
"@img/sharp-win32-x64": "0.34.5"
|
"@img/sharp-win32-ia32": "0.35.1",
|
||||||
|
"@img/sharp-win32-x64": "0.35.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sharp/node_modules/semver": {
|
"node_modules/sharp/node_modules/semver": {
|
||||||
"version": "7.7.4",
|
"version": "7.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz",
|
||||||
"integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
|
"integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -3944,9 +3969,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/sort-package-json": {
|
"node_modules/sort-package-json": {
|
||||||
"version": "3.6.1",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-3.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-4.0.0.tgz",
|
||||||
"integrity": "sha512-Chgejw1+10p2D0U2tB7au1lHtz6TkFnxmvZktyBCRyV0GgmF6nl1IxXxAsPtJVsUyg/fo+BfCMAVVFUVRkAHrQ==",
|
"integrity": "sha512-6aYOlYI9AWioZ+rzu+4zKLmoFqJP0/fHDxrd7X04yqEibikY+5YVF0EYlyGn4v6X2PJY7yAUWV7oeP+i5rOm/g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3962,7 +3987,7 @@
|
|||||||
"sort-package-json": "cli.js"
|
"sort-package-json": "cli.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=22"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sort-package-json/node_modules/semver": {
|
"node_modules/sort-package-json/node_modules/semver": {
|
||||||
@@ -4049,9 +4074,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/stylelint": {
|
"node_modules/stylelint": {
|
||||||
"version": "17.12.0",
|
"version": "17.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-17.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-17.13.0.tgz",
|
||||||
"integrity": "sha512-KIlzWXMHUvgfPUR0R7TK3H80yCIi0uoivUwf+6Az4yrHJD1Q3c1qIkh/H5Z0i/K3QXgtq/UMEkWyBUSUwnpnOg==",
|
"integrity": "sha512-G1WYzMerp7ihOaIe9VJCHLt12MoAD2QLf1AFerYP37+BCRBUK5UCpq8e/mN+zCIaJPKQcaxhE4WlPmqdiOx/gw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -4065,9 +4090,9 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@csstools/css-calc": "^3.2.0",
|
"@csstools/css-calc": "^3.2.1",
|
||||||
"@csstools/css-parser-algorithms": "^4.0.0",
|
"@csstools/css-parser-algorithms": "^4.0.0",
|
||||||
"@csstools/css-syntax-patches-for-csstree": "^1.1.3",
|
"@csstools/css-syntax-patches-for-csstree": "^1.1.4",
|
||||||
"@csstools/css-tokenizer": "^4.0.0",
|
"@csstools/css-tokenizer": "^4.0.0",
|
||||||
"@csstools/media-query-list-parser": "^5.0.0",
|
"@csstools/media-query-list-parser": "^5.0.0",
|
||||||
"@csstools/selector-resolve-nested": "^4.0.0",
|
"@csstools/selector-resolve-nested": "^4.0.0",
|
||||||
@@ -4091,7 +4116,7 @@
|
|||||||
"micromatch": "^4.0.8",
|
"micromatch": "^4.0.8",
|
||||||
"normalize-path": "^3.0.0",
|
"normalize-path": "^3.0.0",
|
||||||
"picocolors": "^1.1.1",
|
"picocolors": "^1.1.1",
|
||||||
"postcss": "^8.5.14",
|
"postcss": "^8.5.15",
|
||||||
"postcss-safe-parser": "^7.0.1",
|
"postcss-safe-parser": "^7.0.1",
|
||||||
"postcss-selector-parser": "^7.1.1",
|
"postcss-selector-parser": "^7.1.1",
|
||||||
"postcss-value-parser": "^4.2.0",
|
"postcss-value-parser": "^4.2.0",
|
||||||
@@ -4467,9 +4492,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "7.24.6",
|
"version": "8.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
|
||||||
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
|
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,16 +29,16 @@
|
|||||||
"swiped-events": "1.2.0"
|
"swiped-events": "1.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.4.16",
|
"@biomejs/biome": "2.5.0",
|
||||||
"@types/node": "^25.9.1",
|
"@types/node": "^26.0.0",
|
||||||
"browserslist": "^4.28.2",
|
"browserslist": "^4.28.2",
|
||||||
"browserslist-to-esbuild": "^2.1.1",
|
"browserslist-to-esbuild": "^2.1.1",
|
||||||
"edge.js": "^6.5.1",
|
"edge.js": "^6.5.1",
|
||||||
"less": "^4.6.4",
|
"less": "^4.6.6",
|
||||||
"mathjs": "^15.2.0",
|
"mathjs": "^15.2.0",
|
||||||
"sharp": "~0.34.5",
|
"sharp": "~0.35.1",
|
||||||
"sort-package-json": "^3.6.1",
|
"sort-package-json": "^4.0.0",
|
||||||
"stylelint": "^17.12.0",
|
"stylelint": "^17.13.0",
|
||||||
"stylelint-config-standard-less": "^4.1.0",
|
"stylelint-config-standard-less": "^4.1.0",
|
||||||
"stylelint-prettier": "^5.0.3",
|
"stylelint-prettier": "^5.0.3",
|
||||||
"svgo": "^4.0.1",
|
"svgo": "^4.0.1",
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ export default class Calculator extends Plugin {
|
|||||||
|
|
||||||
protected async run(): Promise<string | undefined> {
|
protected async run(): Promise<string | undefined> {
|
||||||
const searchInput = getElement<HTMLInputElement>("q");
|
const searchInput = getElement<HTMLInputElement>("q");
|
||||||
const node = Calculator.math.parse(searchInput.value);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const node = Calculator.math.parse(searchInput.value);
|
||||||
return `${node.toString()} = ${node.evaluate()}`;
|
return `${node.toString()} = ${node.evaluate()}`;
|
||||||
} catch {
|
} catch {
|
||||||
// not a compatible math expression
|
// not a compatible math expression
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ RUN --mount=type=cache,id=uv,target=/root/.cache/uv set -eux -o pipefail; \
|
|||||||
|
|
||||||
COPY --exclude=./searx/version_frozen.py ./searx/ ./searx/
|
COPY --exclude=./searx/version_frozen.py ./searx/ ./searx/
|
||||||
|
|
||||||
ARG TIMESTAMP_SETTINGS="0"
|
|
||||||
|
|
||||||
RUN set -eux -o pipefail; \
|
RUN set -eux -o pipefail; \
|
||||||
python -m compileall -q -f -j 0 --invalidation-mode=unchecked-hash ./searx/; \
|
python -m compileall -q -f -j 0 --invalidation-mode=unchecked-hash ./searx/; \
|
||||||
find ./searx/static/ -type f \
|
find ./searx/static/ -type f \
|
||||||
@@ -30,5 +28,4 @@ RUN set -eux -o pipefail; \
|
|||||||
-exec gzip -9 -k {} + \
|
-exec gzip -9 -k {} + \
|
||||||
-exec brotli -9 -k {} + \
|
-exec brotli -9 -k {} + \
|
||||||
-exec gzip --test {}.gz + \
|
-exec gzip --test {}.gz + \
|
||||||
-exec brotli --test {}.br +; \
|
-exec brotli --test {}.br +
|
||||||
touch -c --date="@$TIMESTAMP_SETTINGS" ./searx/settings.yml
|
|
||||||
|
|||||||
+9
-30
@@ -77,43 +77,23 @@ volume_handler() {
|
|||||||
setup_ownership "$target" "directory"
|
setup_ownership "$target" "directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle configuration file updates
|
setup() {
|
||||||
config_handler() {
|
local template_settings="/usr/local/searxng/settings.template.yml"
|
||||||
local target="$1"
|
local target_settings="$__SEARXNG_CONFIG_PATH/settings.yml"
|
||||||
local template="$2"
|
|
||||||
local new_template_target="$target.new"
|
|
||||||
|
|
||||||
# Create/Update the configuration file
|
|
||||||
if [ -f "$target" ]; then
|
|
||||||
setup_ownership "$target" "file"
|
|
||||||
|
|
||||||
if [ "$template" -nt "$target" ]; then
|
|
||||||
cp -pfT "$template" "$new_template_target"
|
|
||||||
|
|
||||||
|
if [ ! -f "$target_settings" ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
...
|
...
|
||||||
... INFORMATION
|
... INFORMATION
|
||||||
... Update available for "$target"
|
... "$target_settings" does not exist, creating from template...
|
||||||
... It is recommended to update the configuration file to ensure proper functionality
|
|
||||||
...
|
|
||||||
... New version placed at "$new_template_target"
|
|
||||||
... Please review and merge changes
|
|
||||||
...
|
...
|
||||||
EOF
|
EOF
|
||||||
fi
|
cp -pfT "$template_settings" "$target_settings"
|
||||||
else
|
|
||||||
cat <<EOF
|
|
||||||
...
|
|
||||||
... INFORMATION
|
|
||||||
... "$target" does not exist, creating from template...
|
|
||||||
...
|
|
||||||
EOF
|
|
||||||
cp -pfT "$template" "$target"
|
|
||||||
|
|
||||||
sed -i "s/ultrasecretkey/$(head -c 24 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9')/g" "$target"
|
sed -i "s/ultrasecretkey/$(head -c 24 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9')/g" "$target_settings"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_file "$target"
|
check_file "$target_settings"
|
||||||
}
|
}
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@@ -124,8 +104,7 @@ EOF
|
|||||||
volume_handler "$__SEARXNG_CONFIG_PATH"
|
volume_handler "$__SEARXNG_CONFIG_PATH"
|
||||||
volume_handler "$__SEARXNG_DATA_PATH"
|
volume_handler "$__SEARXNG_DATA_PATH"
|
||||||
|
|
||||||
# Check for files
|
setup
|
||||||
config_handler "$__SEARXNG_SETTINGS_PATH" "/usr/local/searxng/searx/settings.yml"
|
|
||||||
|
|
||||||
# root only features
|
# root only features
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# Read the documentation before extending the defaults:
|
||||||
|
# https://docs.searxng.org/admin/settings/
|
||||||
|
|
||||||
|
use_default_settings: true
|
||||||
|
|
||||||
|
server:
|
||||||
|
secret_key: "ultrasecretkey"
|
||||||
|
image_proxy: true
|
||||||
@@ -43,6 +43,7 @@
|
|||||||
- ``google``
|
- ``google``
|
||||||
- ``mwmbl``
|
- ``mwmbl``
|
||||||
- ``naver``
|
- ``naver``
|
||||||
|
- ``privacywall``
|
||||||
- ``quark``
|
- ``quark``
|
||||||
- ``qwant``
|
- ``qwant``
|
||||||
- ``seznam``
|
- ``seznam``
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
.. _aol engine:
|
|
||||||
|
|
||||||
===
|
|
||||||
AOL
|
|
||||||
===
|
|
||||||
|
|
||||||
.. automodule:: searx.engines.aol
|
|
||||||
:members:
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.. _kagi engines:
|
||||||
|
|
||||||
|
============
|
||||||
|
Kagi Engines
|
||||||
|
============
|
||||||
|
|
||||||
|
.. automodule:: searx.engines.kagi
|
||||||
|
:members:
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ Parameters
|
|||||||
|
|
||||||
``autocomplete`` : default from :ref:`settings search`
|
``autocomplete`` : default from :ref:`settings search`
|
||||||
[ ``google``, ``dbpedia``, ``duckduckgo``, ``mwmbl``, ``startpage``,
|
[ ``google``, ``dbpedia``, ``duckduckgo``, ``mwmbl``, ``startpage``,
|
||||||
``wikipedia``, ``swisscows``, ``qwant`` ]
|
``privacywall``, ``wikipedia``, ``swisscows``, ``qwant`` ]
|
||||||
|
|
||||||
Service which completes words as you type.
|
Service which completes words as you type.
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ Configured Engines
|
|||||||
{% for mod in engines %}
|
{% for mod in engines %}
|
||||||
|
|
||||||
* - `{{mod.name}} <{{mod.about and mod.about.website}}>`_
|
* - `{{mod.name}} <{{mod.about and mod.about.website}}>`_
|
||||||
{%- if mod.about and mod.about.language %}
|
{%- if mod.language %}
|
||||||
({{mod.about.language | upper}})
|
({{mod.language | upper}})
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
- ``!{{mod.shortcut}}``
|
- ``!{{mod.shortcut}}``
|
||||||
- {%- if 'searx.engines.' + mod.__name__ in documented_modules %}
|
- {%- if 'searx.engines.' + mod.__name__ in documented_modules %}
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ mock==5.2.0
|
|||||||
nose2[coverage_plugin]==0.16.0
|
nose2[coverage_plugin]==0.16.0
|
||||||
cov-core==1.15.0
|
cov-core==1.15.0
|
||||||
black==25.9.0
|
black==25.9.0
|
||||||
pylint==4.0.5
|
pylint==4.0.6
|
||||||
splinter==0.21.0
|
splinter==0.21.0
|
||||||
selenium==4.44.0
|
selenium==4.45.0
|
||||||
Sphinx==8.2.3;python_version <= "3.11"
|
Sphinx==8.2.3;python_version <= "3.11"
|
||||||
Sphinx==9.1.0; python_version > "3.11"
|
Sphinx==9.1.0; python_version > "3.11"
|
||||||
sphinx-issues==6.0.0
|
sphinx-issues==6.0.0
|
||||||
sphinx-jinja==2.0.2
|
sphinx-jinja==2.0.2
|
||||||
sphinx-tabs==3.5.0
|
sphinx-tabs==3.5.0
|
||||||
furo==2025.12.19
|
furo==2025.12.19
|
||||||
sphinxcontrib-programoutput==0.19
|
sphinxcontrib-programoutput==0.20
|
||||||
sphinx-autobuild==2025.8.25
|
sphinx-autobuild==2025.8.25
|
||||||
sphinx-notfound-page==1.1.0
|
sphinx-notfound-page==1.1.0
|
||||||
myst-parser==5.0.0
|
myst-parser==5.0.0
|
||||||
@@ -23,6 +23,6 @@ coloredlogs==15.0.1
|
|||||||
docutils>=0.21.2;python_version <= "3.11"
|
docutils>=0.21.2;python_version <= "3.11"
|
||||||
docutils>=0.22.4; python_version > "3.11"
|
docutils>=0.22.4; python_version > "3.11"
|
||||||
parameterized==0.9.0
|
parameterized==0.9.0
|
||||||
granian[reload]==2.7.5
|
granian[reload]==2.7.6
|
||||||
basedpyright==1.39.6
|
basedpyright==1.39.8
|
||||||
types-lxml==2026.2.16
|
types-lxml==2026.2.16
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
granian==2.7.5
|
granian==2.7.6
|
||||||
granian[pname]==2.7.5
|
granian[pname]==2.7.6
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
certifi==2026.5.20
|
certifi==2026.6.17
|
||||||
babel==2.18.0
|
babel==2.18.0
|
||||||
flask-babel==4.0.0
|
flask-babel==4.0.0
|
||||||
flask==3.1.3
|
flask==3.1.3
|
||||||
|
|||||||
@@ -179,6 +179,23 @@ def naver(query: str, _sxng_locale: str) -> list[str]:
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
def privacywall(query: str, sxng_locale: str) -> list[str]:
|
||||||
|
# Privacywall search autocompleter
|
||||||
|
country = None
|
||||||
|
if "-" in sxng_locale:
|
||||||
|
country = sxng_locale.split("-")[1]
|
||||||
|
args = {'q': query, 'cc': country}
|
||||||
|
|
||||||
|
url = f"https://www.privacywall.org/search/secure/suggestions.php?{urlencode(args)}"
|
||||||
|
response = get(url)
|
||||||
|
|
||||||
|
if not response.ok:
|
||||||
|
return []
|
||||||
|
|
||||||
|
data: list[list[str]] = response.json()
|
||||||
|
return data[1]
|
||||||
|
|
||||||
|
|
||||||
def qihu360search(query: str, _sxng_locale: str) -> list[str]:
|
def qihu360search(query: str, _sxng_locale: str) -> list[str]:
|
||||||
# 360Search search autocompleter
|
# 360Search search autocompleter
|
||||||
url = f"https://sug.so.360.cn/suggest?{urlencode({'format': 'json', 'word': query})}"
|
url = f"https://sug.so.360.cn/suggest?{urlencode({'format': 'json', 'word': query})}"
|
||||||
@@ -361,6 +378,7 @@ backends: dict[str, t.Callable[[str, str], list[str]]] = {
|
|||||||
'google': google_complete,
|
'google': google_complete,
|
||||||
'mwmbl': mwmbl,
|
'mwmbl': mwmbl,
|
||||||
'naver': naver,
|
'naver': naver,
|
||||||
|
'privacywall': privacywall,
|
||||||
'quark': quark,
|
'quark': quark,
|
||||||
'qwant': qwant,
|
'qwant': qwant,
|
||||||
'seznam': seznam,
|
'seznam': seznam,
|
||||||
|
|||||||
@@ -6634,6 +6634,255 @@
|
|||||||
},
|
},
|
||||||
"regions": {}
|
"regions": {}
|
||||||
},
|
},
|
||||||
|
"privacywall": {
|
||||||
|
"all_locale": null,
|
||||||
|
"custom": {},
|
||||||
|
"data_type": "traits_v1",
|
||||||
|
"languages": {},
|
||||||
|
"regions": {
|
||||||
|
"bg-BG": "BG",
|
||||||
|
"cs-CZ": "CZ",
|
||||||
|
"da-DK": "DK",
|
||||||
|
"de-AT": "AT",
|
||||||
|
"de-BE": "BE",
|
||||||
|
"de-CH": "CH",
|
||||||
|
"de-DE": "DE",
|
||||||
|
"de-LI": "LI",
|
||||||
|
"de-LU": "LU",
|
||||||
|
"el-CY": "CY",
|
||||||
|
"el-GR": "GR",
|
||||||
|
"en-AU": "AU",
|
||||||
|
"en-CA": "CA",
|
||||||
|
"en-GB": "GB",
|
||||||
|
"en-HK": "HK",
|
||||||
|
"en-IE": "IE",
|
||||||
|
"en-IN": "IN",
|
||||||
|
"en-MT": "MT",
|
||||||
|
"en-NZ": "NZ",
|
||||||
|
"en-PH": "PH",
|
||||||
|
"en-SG": "SG",
|
||||||
|
"en-US": "US",
|
||||||
|
"es-AR": "AR",
|
||||||
|
"es-CL": "CL",
|
||||||
|
"es-CO": "CO",
|
||||||
|
"es-ES": "ES",
|
||||||
|
"es-MX": "MX",
|
||||||
|
"es-PE": "PE",
|
||||||
|
"es-VE": "VE",
|
||||||
|
"et-EE": "EE",
|
||||||
|
"fi-FI": "FI",
|
||||||
|
"fil-PH": "PH",
|
||||||
|
"fr-BE": "BE",
|
||||||
|
"fr-CA": "CA",
|
||||||
|
"fr-CH": "CH",
|
||||||
|
"fr-FR": "FR",
|
||||||
|
"fr-LU": "LU",
|
||||||
|
"ga-IE": "IE",
|
||||||
|
"gsw-CH": "CH",
|
||||||
|
"gsw-LI": "LI",
|
||||||
|
"hi-IN": "IN",
|
||||||
|
"hr-HR": "HR",
|
||||||
|
"hu-HU": "HU",
|
||||||
|
"id-ID": "ID",
|
||||||
|
"it-CH": "CH",
|
||||||
|
"it-IT": "IT",
|
||||||
|
"ja-JP": "JP",
|
||||||
|
"ko-KR": "KR",
|
||||||
|
"lb-LU": "LU",
|
||||||
|
"lt-LT": "LT",
|
||||||
|
"lv-LV": "LV",
|
||||||
|
"mi-NZ": "NZ",
|
||||||
|
"ms-MY": "MY",
|
||||||
|
"ms-SG": "SG",
|
||||||
|
"mt-MT": "MT",
|
||||||
|
"nb-NO": "NO",
|
||||||
|
"nl-BE": "BE",
|
||||||
|
"nl-NL": "NL",
|
||||||
|
"nn-NO": "NO",
|
||||||
|
"pl-PL": "PL",
|
||||||
|
"pt-BR": "BR",
|
||||||
|
"pt-PT": "PT",
|
||||||
|
"qu-PE": "PE",
|
||||||
|
"ro-RO": "RO",
|
||||||
|
"sk-SK": "SK",
|
||||||
|
"sl-SI": "SI",
|
||||||
|
"sv-FI": "FI",
|
||||||
|
"sv-SE": "SE",
|
||||||
|
"ta-SG": "SG",
|
||||||
|
"th-TH": "TH",
|
||||||
|
"tr-CY": "CY",
|
||||||
|
"vi-VN": "VN",
|
||||||
|
"zh-HK": "HK",
|
||||||
|
"zh-SG": "SG",
|
||||||
|
"zh-TW": "TW"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"privacywall images": {
|
||||||
|
"all_locale": null,
|
||||||
|
"custom": {},
|
||||||
|
"data_type": "traits_v1",
|
||||||
|
"languages": {},
|
||||||
|
"regions": {
|
||||||
|
"bg-BG": "BG",
|
||||||
|
"cs-CZ": "CZ",
|
||||||
|
"da-DK": "DK",
|
||||||
|
"de-AT": "AT",
|
||||||
|
"de-BE": "BE",
|
||||||
|
"de-CH": "CH",
|
||||||
|
"de-DE": "DE",
|
||||||
|
"de-LI": "LI",
|
||||||
|
"de-LU": "LU",
|
||||||
|
"el-CY": "CY",
|
||||||
|
"el-GR": "GR",
|
||||||
|
"en-AU": "AU",
|
||||||
|
"en-CA": "CA",
|
||||||
|
"en-GB": "GB",
|
||||||
|
"en-HK": "HK",
|
||||||
|
"en-IE": "IE",
|
||||||
|
"en-IN": "IN",
|
||||||
|
"en-MT": "MT",
|
||||||
|
"en-NZ": "NZ",
|
||||||
|
"en-PH": "PH",
|
||||||
|
"en-SG": "SG",
|
||||||
|
"en-US": "US",
|
||||||
|
"es-AR": "AR",
|
||||||
|
"es-CL": "CL",
|
||||||
|
"es-CO": "CO",
|
||||||
|
"es-ES": "ES",
|
||||||
|
"es-MX": "MX",
|
||||||
|
"es-PE": "PE",
|
||||||
|
"es-VE": "VE",
|
||||||
|
"et-EE": "EE",
|
||||||
|
"fi-FI": "FI",
|
||||||
|
"fil-PH": "PH",
|
||||||
|
"fr-BE": "BE",
|
||||||
|
"fr-CA": "CA",
|
||||||
|
"fr-CH": "CH",
|
||||||
|
"fr-FR": "FR",
|
||||||
|
"fr-LU": "LU",
|
||||||
|
"ga-IE": "IE",
|
||||||
|
"gsw-CH": "CH",
|
||||||
|
"gsw-LI": "LI",
|
||||||
|
"hi-IN": "IN",
|
||||||
|
"hr-HR": "HR",
|
||||||
|
"hu-HU": "HU",
|
||||||
|
"id-ID": "ID",
|
||||||
|
"it-CH": "CH",
|
||||||
|
"it-IT": "IT",
|
||||||
|
"ja-JP": "JP",
|
||||||
|
"ko-KR": "KR",
|
||||||
|
"lb-LU": "LU",
|
||||||
|
"lt-LT": "LT",
|
||||||
|
"lv-LV": "LV",
|
||||||
|
"mi-NZ": "NZ",
|
||||||
|
"ms-MY": "MY",
|
||||||
|
"ms-SG": "SG",
|
||||||
|
"mt-MT": "MT",
|
||||||
|
"nb-NO": "NO",
|
||||||
|
"nl-BE": "BE",
|
||||||
|
"nl-NL": "NL",
|
||||||
|
"nn-NO": "NO",
|
||||||
|
"pl-PL": "PL",
|
||||||
|
"pt-BR": "BR",
|
||||||
|
"pt-PT": "PT",
|
||||||
|
"qu-PE": "PE",
|
||||||
|
"ro-RO": "RO",
|
||||||
|
"sk-SK": "SK",
|
||||||
|
"sl-SI": "SI",
|
||||||
|
"sv-FI": "FI",
|
||||||
|
"sv-SE": "SE",
|
||||||
|
"ta-SG": "SG",
|
||||||
|
"th-TH": "TH",
|
||||||
|
"tr-CY": "CY",
|
||||||
|
"vi-VN": "VN",
|
||||||
|
"zh-HK": "HK",
|
||||||
|
"zh-SG": "SG",
|
||||||
|
"zh-TW": "TW"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"privacywall videos": {
|
||||||
|
"all_locale": null,
|
||||||
|
"custom": {},
|
||||||
|
"data_type": "traits_v1",
|
||||||
|
"languages": {},
|
||||||
|
"regions": {
|
||||||
|
"bg-BG": "BG",
|
||||||
|
"cs-CZ": "CZ",
|
||||||
|
"da-DK": "DK",
|
||||||
|
"de-AT": "AT",
|
||||||
|
"de-BE": "BE",
|
||||||
|
"de-CH": "CH",
|
||||||
|
"de-DE": "DE",
|
||||||
|
"de-LI": "LI",
|
||||||
|
"de-LU": "LU",
|
||||||
|
"el-CY": "CY",
|
||||||
|
"el-GR": "GR",
|
||||||
|
"en-AU": "AU",
|
||||||
|
"en-CA": "CA",
|
||||||
|
"en-GB": "GB",
|
||||||
|
"en-HK": "HK",
|
||||||
|
"en-IE": "IE",
|
||||||
|
"en-IN": "IN",
|
||||||
|
"en-MT": "MT",
|
||||||
|
"en-NZ": "NZ",
|
||||||
|
"en-PH": "PH",
|
||||||
|
"en-SG": "SG",
|
||||||
|
"en-US": "US",
|
||||||
|
"es-AR": "AR",
|
||||||
|
"es-CL": "CL",
|
||||||
|
"es-CO": "CO",
|
||||||
|
"es-ES": "ES",
|
||||||
|
"es-MX": "MX",
|
||||||
|
"es-PE": "PE",
|
||||||
|
"es-VE": "VE",
|
||||||
|
"et-EE": "EE",
|
||||||
|
"fi-FI": "FI",
|
||||||
|
"fil-PH": "PH",
|
||||||
|
"fr-BE": "BE",
|
||||||
|
"fr-CA": "CA",
|
||||||
|
"fr-CH": "CH",
|
||||||
|
"fr-FR": "FR",
|
||||||
|
"fr-LU": "LU",
|
||||||
|
"ga-IE": "IE",
|
||||||
|
"gsw-CH": "CH",
|
||||||
|
"gsw-LI": "LI",
|
||||||
|
"hi-IN": "IN",
|
||||||
|
"hr-HR": "HR",
|
||||||
|
"hu-HU": "HU",
|
||||||
|
"id-ID": "ID",
|
||||||
|
"it-CH": "CH",
|
||||||
|
"it-IT": "IT",
|
||||||
|
"ja-JP": "JP",
|
||||||
|
"ko-KR": "KR",
|
||||||
|
"lb-LU": "LU",
|
||||||
|
"lt-LT": "LT",
|
||||||
|
"lv-LV": "LV",
|
||||||
|
"mi-NZ": "NZ",
|
||||||
|
"ms-MY": "MY",
|
||||||
|
"ms-SG": "SG",
|
||||||
|
"mt-MT": "MT",
|
||||||
|
"nb-NO": "NO",
|
||||||
|
"nl-BE": "BE",
|
||||||
|
"nl-NL": "NL",
|
||||||
|
"nn-NO": "NO",
|
||||||
|
"pl-PL": "PL",
|
||||||
|
"pt-BR": "BR",
|
||||||
|
"pt-PT": "PT",
|
||||||
|
"qu-PE": "PE",
|
||||||
|
"ro-RO": "RO",
|
||||||
|
"sk-SK": "SK",
|
||||||
|
"sl-SI": "SI",
|
||||||
|
"sv-FI": "FI",
|
||||||
|
"sv-SE": "SE",
|
||||||
|
"ta-SG": "SG",
|
||||||
|
"th-TH": "TH",
|
||||||
|
"tr-CY": "CY",
|
||||||
|
"vi-VN": "VN",
|
||||||
|
"zh-HK": "HK",
|
||||||
|
"zh-SG": "SG",
|
||||||
|
"zh-TW": "TW"
|
||||||
|
}
|
||||||
|
},
|
||||||
"qwant": {
|
"qwant": {
|
||||||
"all_locale": null,
|
"all_locale": null,
|
||||||
"custom": {},
|
"custom": {},
|
||||||
@@ -7175,6 +7424,222 @@
|
|||||||
},
|
},
|
||||||
"regions": {}
|
"regions": {}
|
||||||
},
|
},
|
||||||
|
"resulthunter": {
|
||||||
|
"all_locale": "all",
|
||||||
|
"custom": {
|
||||||
|
"ui_lang": {
|
||||||
|
"az": "az",
|
||||||
|
"bg": "bg",
|
||||||
|
"br": "br",
|
||||||
|
"ca": "ca",
|
||||||
|
"cs": "cs",
|
||||||
|
"cy": "cy",
|
||||||
|
"da": "da",
|
||||||
|
"de-DE": "de-de",
|
||||||
|
"el": "el",
|
||||||
|
"en-CA": "en-ca",
|
||||||
|
"en-GB": "en-gb",
|
||||||
|
"en-IN": "en-in",
|
||||||
|
"en-US": "en-us",
|
||||||
|
"es": "es",
|
||||||
|
"et": "et",
|
||||||
|
"eu": "eu",
|
||||||
|
"fi-FI": "fi-fi",
|
||||||
|
"fr-CA": "fr-ca",
|
||||||
|
"fr-FR": "fr-fr",
|
||||||
|
"gl": "gl",
|
||||||
|
"hr": "hr",
|
||||||
|
"hu": "hu",
|
||||||
|
"id": "id",
|
||||||
|
"it": "it",
|
||||||
|
"ja-JP": "ja-jp",
|
||||||
|
"ka": "ka",
|
||||||
|
"ko": "ko",
|
||||||
|
"lt": "lt",
|
||||||
|
"lv": "lv",
|
||||||
|
"ms": "ms",
|
||||||
|
"nb": "nb",
|
||||||
|
"nl": "nl",
|
||||||
|
"pl": "pl",
|
||||||
|
"pt-BR": "pt-br",
|
||||||
|
"ro": "ro",
|
||||||
|
"ru": "ru",
|
||||||
|
"sk": "sk",
|
||||||
|
"sl": "sl",
|
||||||
|
"sq-AL": "sq-al",
|
||||||
|
"sr": "sr",
|
||||||
|
"sr_Latn": "sr-latn",
|
||||||
|
"sv": "sv",
|
||||||
|
"sw-KE": "sw-ke",
|
||||||
|
"th": "th",
|
||||||
|
"tr": "tr",
|
||||||
|
"uk": "uk",
|
||||||
|
"vi": "vi",
|
||||||
|
"zh": "zh",
|
||||||
|
"zh-TW": "zh-tw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"data_type": "traits_v1",
|
||||||
|
"languages": {},
|
||||||
|
"regions": {
|
||||||
|
"ar-SA": "sa",
|
||||||
|
"da-DK": "dk",
|
||||||
|
"de-AT": "at",
|
||||||
|
"de-BE": "be",
|
||||||
|
"de-CH": "ch",
|
||||||
|
"de-DE": "de",
|
||||||
|
"en-AU": "au",
|
||||||
|
"en-CA": "ca",
|
||||||
|
"en-GB": "gb",
|
||||||
|
"en-HK": "hk",
|
||||||
|
"en-IN": "in",
|
||||||
|
"en-NZ": "nz",
|
||||||
|
"en-PH": "ph",
|
||||||
|
"en-US": "us",
|
||||||
|
"en-ZA": "za",
|
||||||
|
"es-AR": "ar",
|
||||||
|
"es-CL": "cl",
|
||||||
|
"es-ES": "es",
|
||||||
|
"es-MX": "mx",
|
||||||
|
"fi-FI": "fi",
|
||||||
|
"fil-PH": "ph",
|
||||||
|
"fr-BE": "be",
|
||||||
|
"fr-CA": "ca",
|
||||||
|
"fr-CH": "ch",
|
||||||
|
"fr-FR": "fr",
|
||||||
|
"gsw-CH": "ch",
|
||||||
|
"hi-IN": "in",
|
||||||
|
"id-ID": "id",
|
||||||
|
"it-CH": "ch",
|
||||||
|
"it-IT": "it",
|
||||||
|
"ja-JP": "jp",
|
||||||
|
"ko-KR": "kr",
|
||||||
|
"mi-NZ": "nz",
|
||||||
|
"ms-MY": "my",
|
||||||
|
"nb-NO": "no",
|
||||||
|
"nl-BE": "be",
|
||||||
|
"nl-NL": "nl",
|
||||||
|
"nn-NO": "no",
|
||||||
|
"pl-PL": "pl",
|
||||||
|
"pt-BR": "br",
|
||||||
|
"pt-PT": "pt",
|
||||||
|
"ru-RU": "ru",
|
||||||
|
"sv-FI": "fi",
|
||||||
|
"sv-SE": "se",
|
||||||
|
"tr-TR": "tr",
|
||||||
|
"zh-CN": "cn",
|
||||||
|
"zh-HK": "hk",
|
||||||
|
"zh-TW": "tw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resulthunter images": {
|
||||||
|
"all_locale": "all",
|
||||||
|
"custom": {
|
||||||
|
"ui_lang": {
|
||||||
|
"az": "az",
|
||||||
|
"bg": "bg",
|
||||||
|
"br": "br",
|
||||||
|
"ca": "ca",
|
||||||
|
"cs": "cs",
|
||||||
|
"cy": "cy",
|
||||||
|
"da": "da",
|
||||||
|
"de-DE": "de-de",
|
||||||
|
"el": "el",
|
||||||
|
"en-CA": "en-ca",
|
||||||
|
"en-GB": "en-gb",
|
||||||
|
"en-IN": "en-in",
|
||||||
|
"en-US": "en-us",
|
||||||
|
"es": "es",
|
||||||
|
"et": "et",
|
||||||
|
"eu": "eu",
|
||||||
|
"fi-FI": "fi-fi",
|
||||||
|
"fr-CA": "fr-ca",
|
||||||
|
"fr-FR": "fr-fr",
|
||||||
|
"gl": "gl",
|
||||||
|
"hr": "hr",
|
||||||
|
"hu": "hu",
|
||||||
|
"id": "id",
|
||||||
|
"it": "it",
|
||||||
|
"ja-JP": "ja-jp",
|
||||||
|
"ka": "ka",
|
||||||
|
"ko": "ko",
|
||||||
|
"lt": "lt",
|
||||||
|
"lv": "lv",
|
||||||
|
"ms": "ms",
|
||||||
|
"nb": "nb",
|
||||||
|
"nl": "nl",
|
||||||
|
"pl": "pl",
|
||||||
|
"pt-BR": "pt-br",
|
||||||
|
"ro": "ro",
|
||||||
|
"ru": "ru",
|
||||||
|
"sk": "sk",
|
||||||
|
"sl": "sl",
|
||||||
|
"sq-AL": "sq-al",
|
||||||
|
"sr": "sr",
|
||||||
|
"sr_Latn": "sr-latn",
|
||||||
|
"sv": "sv",
|
||||||
|
"sw-KE": "sw-ke",
|
||||||
|
"th": "th",
|
||||||
|
"tr": "tr",
|
||||||
|
"uk": "uk",
|
||||||
|
"vi": "vi",
|
||||||
|
"zh": "zh",
|
||||||
|
"zh-TW": "zh-tw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"data_type": "traits_v1",
|
||||||
|
"languages": {},
|
||||||
|
"regions": {
|
||||||
|
"ar-SA": "sa",
|
||||||
|
"da-DK": "dk",
|
||||||
|
"de-AT": "at",
|
||||||
|
"de-BE": "be",
|
||||||
|
"de-CH": "ch",
|
||||||
|
"de-DE": "de",
|
||||||
|
"en-AU": "au",
|
||||||
|
"en-CA": "ca",
|
||||||
|
"en-GB": "gb",
|
||||||
|
"en-HK": "hk",
|
||||||
|
"en-IN": "in",
|
||||||
|
"en-NZ": "nz",
|
||||||
|
"en-PH": "ph",
|
||||||
|
"en-US": "us",
|
||||||
|
"en-ZA": "za",
|
||||||
|
"es-AR": "ar",
|
||||||
|
"es-CL": "cl",
|
||||||
|
"es-ES": "es",
|
||||||
|
"es-MX": "mx",
|
||||||
|
"fi-FI": "fi",
|
||||||
|
"fil-PH": "ph",
|
||||||
|
"fr-BE": "be",
|
||||||
|
"fr-CA": "ca",
|
||||||
|
"fr-CH": "ch",
|
||||||
|
"fr-FR": "fr",
|
||||||
|
"gsw-CH": "ch",
|
||||||
|
"hi-IN": "in",
|
||||||
|
"id-ID": "id",
|
||||||
|
"it-CH": "ch",
|
||||||
|
"it-IT": "it",
|
||||||
|
"ja-JP": "jp",
|
||||||
|
"ko-KR": "kr",
|
||||||
|
"mi-NZ": "nz",
|
||||||
|
"ms-MY": "my",
|
||||||
|
"nb-NO": "no",
|
||||||
|
"nl-BE": "be",
|
||||||
|
"nl-NL": "nl",
|
||||||
|
"nn-NO": "no",
|
||||||
|
"pl-PL": "pl",
|
||||||
|
"pt-BR": "br",
|
||||||
|
"pt-PT": "pt",
|
||||||
|
"ru-RU": "ru",
|
||||||
|
"sv-FI": "fi",
|
||||||
|
"sv-SE": "se",
|
||||||
|
"tr-TR": "tr",
|
||||||
|
"zh-CN": "cn",
|
||||||
|
"zh-HK": "hk",
|
||||||
|
"zh-TW": "tw"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sepiasearch": {
|
"sepiasearch": {
|
||||||
"all_locale": null,
|
"all_locale": null,
|
||||||
"custom": {},
|
"custom": {},
|
||||||
|
|||||||
+161
-111
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
- :py:obj:`searx.enginelib.EngineCache`
|
- :py:obj:`searx.enginelib.EngineCache`
|
||||||
- :py:obj:`searx.enginelib.Engine`
|
- :py:obj:`searx.enginelib.Engine`
|
||||||
|
- :py:obj:`searx.enginelib.EngineAbout`
|
||||||
- :py:obj:`searx.enginelib.traits`
|
- :py:obj:`searx.enginelib.traits`
|
||||||
|
|
||||||
There is a command line for developer purposes and for deeper analysis. Here is
|
There is a command line for developer purposes and for deeper analysis. Here is
|
||||||
@@ -23,7 +24,7 @@ an example in which the command line is called in the development environment::
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__all__ = ["EngineCache", "Engine", "ENGINES_CACHE"]
|
__all__ = ["EngineCache", "Engine", "EngineAbout", "ENGINES_CACHE"]
|
||||||
|
|
||||||
import typing as t
|
import typing as t
|
||||||
import abc
|
import abc
|
||||||
@@ -31,6 +32,7 @@ from collections.abc import Callable
|
|||||||
import logging
|
import logging
|
||||||
import string
|
import string
|
||||||
import typer
|
import typer
|
||||||
|
import msgspec
|
||||||
|
|
||||||
from ..cache import ExpireCacheSQLite, ExpireCacheCfg
|
from ..cache import ExpireCacheSQLite, ExpireCacheCfg
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ if t.TYPE_CHECKING:
|
|||||||
from searx.enginelib.traits import EngineTraits
|
from searx.enginelib.traits import EngineTraits
|
||||||
from searx.extended_types import SXNG_Response
|
from searx.extended_types import SXNG_Response
|
||||||
from searx.result_types import EngineResults
|
from searx.result_types import EngineResults
|
||||||
from searx.search.processors import OfflineParamTypes, OnlineParamTypes
|
from searx.search.processors import OfflineParamTypes, OnlineParamTypes, ProcessorType
|
||||||
|
|
||||||
ENGINES_CACHE: ExpireCacheSQLite = ExpireCacheSQLite.build_cache(
|
ENGINES_CACHE: ExpireCacheSQLite = ExpireCacheSQLite.build_cache(
|
||||||
ExpireCacheCfg(
|
ExpireCacheCfg(
|
||||||
@@ -178,111 +180,7 @@ class EngineCache:
|
|||||||
return ENGINES_CACHE.secret_hash(name=name)
|
return ENGINES_CACHE.secret_hash(name=name)
|
||||||
|
|
||||||
|
|
||||||
class Engine(abc.ABC): # pylint: disable=too-few-public-methods
|
class EngineAbout(msgspec.Struct, kw_only=True):
|
||||||
"""Class of engine instances build from YAML settings.
|
|
||||||
|
|
||||||
Further documentation see :ref:`general engine configuration`.
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
This class is currently never initialized and only used for type hinting.
|
|
||||||
"""
|
|
||||||
|
|
||||||
logger: logging.Logger
|
|
||||||
|
|
||||||
# Common options in the engine module
|
|
||||||
|
|
||||||
engine_type: str
|
|
||||||
"""Type of the engine (:ref:`searx.search.processors`)"""
|
|
||||||
|
|
||||||
paging: bool
|
|
||||||
"""Engine supports multiple pages."""
|
|
||||||
|
|
||||||
max_page: int = 0
|
|
||||||
"""If the engine supports paging, then this is the value for the last page
|
|
||||||
that is still supported. ``0`` means unlimited numbers of pages."""
|
|
||||||
|
|
||||||
time_range_support: bool
|
|
||||||
"""Engine supports search time range."""
|
|
||||||
|
|
||||||
safesearch: bool
|
|
||||||
"""Engine supports SafeSearch"""
|
|
||||||
|
|
||||||
language_support: bool
|
|
||||||
"""Engine supports languages (locales) search."""
|
|
||||||
|
|
||||||
language: str
|
|
||||||
"""For an engine, when there is ``language: ...`` in the YAML settings the engine
|
|
||||||
does support only this one language:
|
|
||||||
|
|
||||||
.. code:: yaml
|
|
||||||
|
|
||||||
- name: google french
|
|
||||||
engine: google
|
|
||||||
language: fr
|
|
||||||
"""
|
|
||||||
|
|
||||||
region: str
|
|
||||||
"""For an engine, when there is ``region: ...`` in the YAML settings the engine
|
|
||||||
does support only this one region::
|
|
||||||
|
|
||||||
.. code:: yaml
|
|
||||||
|
|
||||||
- name: google belgium
|
|
||||||
engine: google
|
|
||||||
region: fr-BE
|
|
||||||
"""
|
|
||||||
|
|
||||||
fetch_traits: "Callable[[EngineTraits, bool], None]"
|
|
||||||
"""Function to to fetch engine's traits from origin."""
|
|
||||||
|
|
||||||
traits: "traits.EngineTraits"
|
|
||||||
"""Traits of the engine."""
|
|
||||||
|
|
||||||
# settings.yml
|
|
||||||
|
|
||||||
categories: list[str]
|
|
||||||
"""Specifies to which :ref:`engine categories` the engine should be added."""
|
|
||||||
|
|
||||||
name: str
|
|
||||||
"""Name that will be used across SearXNG to define this engine. In settings, on
|
|
||||||
the result page .."""
|
|
||||||
|
|
||||||
engine: str
|
|
||||||
"""Name of the python file used to handle requests and responses to and from
|
|
||||||
this search engine (file name from :origin:`searx/engines` without
|
|
||||||
``.py``)."""
|
|
||||||
|
|
||||||
enable_http: bool
|
|
||||||
"""Enable HTTP (by default only HTTPS is enabled)."""
|
|
||||||
|
|
||||||
shortcut: str
|
|
||||||
"""Code used to execute bang requests (``!foo``)"""
|
|
||||||
|
|
||||||
timeout: float
|
|
||||||
"""Specific timeout for search-engine."""
|
|
||||||
|
|
||||||
display_error_messages: bool
|
|
||||||
"""Display error messages on the web UI."""
|
|
||||||
|
|
||||||
proxies: dict[str, dict[str, str]]
|
|
||||||
"""Set proxies for a specific engine (YAML):
|
|
||||||
|
|
||||||
.. code:: yaml
|
|
||||||
|
|
||||||
proxies :
|
|
||||||
http: socks5://proxy:port
|
|
||||||
https: socks5://proxy:port
|
|
||||||
"""
|
|
||||||
|
|
||||||
disabled: bool
|
|
||||||
"""To disable by default the engine, but not deleting it. It will allow the
|
|
||||||
user to manually activate it in the settings."""
|
|
||||||
|
|
||||||
inactive: bool
|
|
||||||
"""Remove the engine from the settings (*disabled & removed*)."""
|
|
||||||
|
|
||||||
about: dict[str, dict[str, str]]
|
|
||||||
"""Additional fields describing the engine.
|
"""Additional fields describing the engine.
|
||||||
|
|
||||||
.. code:: yaml
|
.. code:: yaml
|
||||||
@@ -296,21 +194,173 @@ class Engine(abc.ABC): # pylint: disable=too-few-public-methods
|
|||||||
results: HTML
|
results: HTML
|
||||||
"""
|
"""
|
||||||
|
|
||||||
using_tor_proxy: bool
|
# pylint: disable=too-few-public-methods
|
||||||
|
|
||||||
|
website: str = ""
|
||||||
|
"""Official web-site of the origin."""
|
||||||
|
|
||||||
|
wikidata_id: str = ""
|
||||||
|
"""`Wikidata ID <https://www.wikidata.org/wiki/Wikidata:Identifiers>`_"""
|
||||||
|
|
||||||
|
official_api_documentation: str = ""
|
||||||
|
"""URL of the official API (regardless of whether it is used)"""
|
||||||
|
|
||||||
|
use_official_api: bool = False
|
||||||
|
"""SearXNG engine makes use of the official API or not"""
|
||||||
|
require_api_key: bool = False
|
||||||
|
"""API requires a key or not."""
|
||||||
|
|
||||||
|
results: str = ""
|
||||||
|
"""Data format of the source (online-engines: of the response)."""
|
||||||
|
|
||||||
|
description: str = ""
|
||||||
|
"""Brief description of the engine and where it gets its data from.
|
||||||
|
|
||||||
|
This value should only be set as long as no description of the data source
|
||||||
|
is available via a :py:obj:`EngineAbout.wikidata_id`.
|
||||||
|
"""
|
||||||
|
|
||||||
|
language: str = ""
|
||||||
|
"""Deprecated! Migrate your setting from `engine.about.language` to
|
||||||
|
`engine.language`"""
|
||||||
|
|
||||||
|
|
||||||
|
class Engine(abc.ABC): # pylint: disable=too-few-public-methods
|
||||||
|
"""Class of engine instances build from YAML settings.
|
||||||
|
|
||||||
|
Further documentation see :ref:`general engine configuration`.
|
||||||
|
|
||||||
|
The defaults are taken from :py:obj:`searx.engines.ENGINE_DEFAULT_ARGS`.
|
||||||
|
|
||||||
|
.. hint::
|
||||||
|
|
||||||
|
This class is currently never initialized and only used for type hinting.
|
||||||
|
"""
|
||||||
|
|
||||||
|
logger: logging.Logger
|
||||||
|
|
||||||
|
# Common options of the engine module
|
||||||
|
|
||||||
|
engine_type: "ProcessorType" = "online"
|
||||||
|
"""Type of the engine (:ref:`searx.search.processors`)"""
|
||||||
|
|
||||||
|
paging: bool = False
|
||||||
|
"""Engine supports multiple pages."""
|
||||||
|
|
||||||
|
max_page: int = 0
|
||||||
|
"""If the engine supports paging, then this is the value for the last page
|
||||||
|
that is still supported. ``0`` means unlimited numbers of pages."""
|
||||||
|
|
||||||
|
time_range_support: bool = False
|
||||||
|
"""Engine supports search time range."""
|
||||||
|
|
||||||
|
safesearch: bool = False
|
||||||
|
"""Engine supports SafeSearch"""
|
||||||
|
|
||||||
|
language_support: bool = False
|
||||||
|
"""Engine supports languages (locales) search."""
|
||||||
|
|
||||||
|
fetch_traits: "Callable[[EngineTraits, bool], None]"
|
||||||
|
"""Function to to fetch engine's traits from origin."""
|
||||||
|
|
||||||
|
traits: "traits.EngineTraits"
|
||||||
|
"""Traits of the engine."""
|
||||||
|
|
||||||
|
# settings.yml
|
||||||
|
|
||||||
|
name: str
|
||||||
|
"""Name that will be used across SearXNG to define this engine. In settings, on
|
||||||
|
the result page .."""
|
||||||
|
|
||||||
|
engine: str
|
||||||
|
"""Name of the python file used to handle requests and responses to and from
|
||||||
|
this search engine (file name from :origin:`searx/engines` without
|
||||||
|
``.py``)."""
|
||||||
|
|
||||||
|
categories: list[str] = ["general"]
|
||||||
|
"""Specifies to which :ref:`engine categories` the engine should be added."""
|
||||||
|
|
||||||
|
language: str = ""
|
||||||
|
"""If the engine supports only one language, this language is specified here
|
||||||
|
(``en``, ``de``, ``"no"`` or ..); otherwise, the value remains empty. For
|
||||||
|
the YAML configuration: think of the `YAML-Norway problem
|
||||||
|
<https://ruuda.nl/2023/the-yaml-document-from-hell#the-norway-problem>`_
|
||||||
|
|
||||||
|
.. code:: yaml
|
||||||
|
|
||||||
|
- name: google norway
|
||||||
|
engine: google
|
||||||
|
language: "no"
|
||||||
|
|
||||||
|
Depending on ``language_support``, this value has similar but also slightly
|
||||||
|
different meanings.
|
||||||
|
|
||||||
|
- When ``language_support`` is **true**, the map of
|
||||||
|
:py:obj:`traits.EngineTraits.languages` is reduced to the selected
|
||||||
|
language
|
||||||
|
|
||||||
|
- When ``language_support`` is **false**, then the implementation of the
|
||||||
|
engine only supports this one ``language``
|
||||||
|
"""
|
||||||
|
|
||||||
|
region: str = ""
|
||||||
|
"""For an engine, when there is ``region: ...`` in the YAML settings the engine
|
||||||
|
does support only this one region::
|
||||||
|
|
||||||
|
.. code:: yaml
|
||||||
|
|
||||||
|
- name: google belgium
|
||||||
|
engine: google
|
||||||
|
region: fr-BE
|
||||||
|
"""
|
||||||
|
|
||||||
|
enable_http: bool
|
||||||
|
"""Enable HTTP (by default only HTTPS is enabled)."""
|
||||||
|
|
||||||
|
shortcut: str
|
||||||
|
"""Code used to execute bang requests (``!foo``)"""
|
||||||
|
|
||||||
|
timeout: float
|
||||||
|
"""Specific timeout for search-engine."""
|
||||||
|
|
||||||
|
display_error_messages: bool
|
||||||
|
"""Display error messages on the web UI."""
|
||||||
|
|
||||||
|
disabled: bool = False
|
||||||
|
"""To disable by default the engine, but not deleting it. It will allow the
|
||||||
|
user to manually activate it in the settings."""
|
||||||
|
|
||||||
|
inactive: bool = False
|
||||||
|
"""Remove the engine from the settings (*disabled & removed*)."""
|
||||||
|
|
||||||
|
about: EngineAbout = EngineAbout()
|
||||||
|
"""Additional fields describing the engine."""
|
||||||
|
|
||||||
|
using_tor_proxy: bool = False
|
||||||
"""Using tor proxy (``true``) or not (``false``) for this engine."""
|
"""Using tor proxy (``true``) or not (``false``) for this engine."""
|
||||||
|
|
||||||
send_accept_language_header: bool
|
send_accept_language_header: bool = True
|
||||||
"""When this option is activated (default), the language (locale) that is
|
"""When this option is activated (default), the language (locale) that is
|
||||||
selected by the user is used to build and send a ``Accept-Language`` header
|
selected by the user is used to build and send a ``Accept-Language`` header
|
||||||
in the request to the origin search engine."""
|
in the request to the origin search engine."""
|
||||||
|
|
||||||
tokens: list[str]
|
tokens: list[str] = []
|
||||||
"""A list of secret tokens to make this engine *private*, more details see
|
"""A list of secret tokens to make this engine *private*, more details see
|
||||||
:ref:`private engines`."""
|
:ref:`private engines`."""
|
||||||
|
|
||||||
weight: int
|
weight: float = 1.0
|
||||||
"""Weighting of the results of this engine (:ref:`weight <settings engines>`)."""
|
"""Weighting of the results of this engine (:ref:`weight <settings engines>`)."""
|
||||||
|
|
||||||
|
proxies: dict[str, dict[str, str]]
|
||||||
|
"""Set proxies for a specific engine (YAML):
|
||||||
|
|
||||||
|
.. code:: yaml
|
||||||
|
|
||||||
|
proxies :
|
||||||
|
http: socks5://proxy:port
|
||||||
|
https: socks5://proxy:port
|
||||||
|
"""
|
||||||
|
|
||||||
def setup(self, engine_settings: dict[str, t.Any]) -> bool: # pylint: disable=unused-argument
|
def setup(self, engine_settings: dict[str, t.Any]) -> bool: # pylint: disable=unused-argument
|
||||||
"""Dynamic setup of the engine settings.
|
"""Dynamic setup of the engine settings.
|
||||||
|
|
||||||
|
|||||||
+14
-11
@@ -142,11 +142,11 @@ class EngineTraits:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if self.data_type == "traits_v1":
|
if self.data_type == "traits_v1":
|
||||||
self._set_traits_v1(engine)
|
self._set_traits_v1(engine) # pyright: ignore[reportArgumentType]
|
||||||
else:
|
else:
|
||||||
raise TypeError("engine traits of type %s is unknown" % self.data_type)
|
raise TypeError("engine traits of type %s is unknown" % self.data_type)
|
||||||
|
|
||||||
def _set_traits_v1(self, engine: "Engine | types.ModuleType") -> None:
|
def _set_traits_v1(self, engine: "Engine") -> None:
|
||||||
# For an engine, when there is `language: ...` in the YAML settings the engine
|
# For an engine, when there is `language: ...` in the YAML settings the engine
|
||||||
# does support only this one language (region)::
|
# does support only this one language (region)::
|
||||||
#
|
#
|
||||||
@@ -159,22 +159,25 @@ class EngineTraits:
|
|||||||
|
|
||||||
_msg = "settings.yml - engine: '%s' / %s: '%s' not supported"
|
_msg = "settings.yml - engine: '%s' / %s: '%s' not supported"
|
||||||
|
|
||||||
languages = traits.languages
|
if engine.language:
|
||||||
if hasattr(engine, "language"):
|
if engine.language_support:
|
||||||
if engine.language not in languages:
|
if not len(traits.languages) > 1:
|
||||||
|
raise ValueError(
|
||||||
|
f"engine {engine.name}: activated language_support with just one or less languages"
|
||||||
|
)
|
||||||
|
if engine.language not in traits.languages:
|
||||||
raise ValueError(_msg % (engine.name, "language", engine.language))
|
raise ValueError(_msg % (engine.name, "language", engine.language))
|
||||||
traits.languages = {engine.language: languages[engine.language]}
|
traits.languages = {engine.language: traits.languages[engine.language]}
|
||||||
|
|
||||||
regions = traits.regions
|
if engine.region:
|
||||||
if hasattr(engine, "region"):
|
if engine.region not in traits.regions:
|
||||||
if engine.region not in regions:
|
|
||||||
raise ValueError(_msg % (engine.name, "region", engine.region))
|
raise ValueError(_msg % (engine.name, "region", engine.region))
|
||||||
traits.regions = {engine.region: regions[engine.region]}
|
traits.regions = {engine.region: traits.regions[engine.region]}
|
||||||
|
|
||||||
engine.language_support = bool(traits.languages or traits.regions)
|
engine.language_support = bool(traits.languages or traits.regions)
|
||||||
|
|
||||||
# set the copied & modified traits in engine's namespace
|
# set the copied & modified traits in engine's namespace
|
||||||
engine.traits = traits # pyright: ignore[reportAttributeAccessIssue]
|
engine.traits = traits
|
||||||
|
|
||||||
|
|
||||||
class EngineTraitsMap(dict[str, EngineTraits]):
|
class EngineTraitsMap(dict[str, EngineTraits]):
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
# Engine Configuration
|
# Engine Configuration
|
||||||
categories = ["general"]
|
categories = ["general"]
|
||||||
|
|||||||
@@ -5,19 +5,19 @@ intended monkey patching of the engine modules.
|
|||||||
.. attention::
|
.. attention::
|
||||||
|
|
||||||
Monkey-patching modules is a practice from the past that shouldn't be
|
Monkey-patching modules is a practice from the past that shouldn't be
|
||||||
expanded upon. In the long run, there should be an engine class that can be
|
expanded upon. In the long run, engines should be instances of
|
||||||
inherited. However, as long as this class doesn't exist, and as long as all
|
:py:obj:`searx.enginelib.Engine`. However, as long as long as all engine
|
||||||
engine modules aren't converted to an engine class, these builtin types will
|
modules aren't converted to this class, these builtin types will still be
|
||||||
still be needed.
|
needed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from searx.enginelib import traits as _traits
|
from searx.enginelib import traits as _traits
|
||||||
|
|
||||||
logger: logging.Logger
|
logger: logging.Logger
|
||||||
supported_languages: str
|
|
||||||
language_aliases: str
|
|
||||||
language_support: bool
|
language_support: bool
|
||||||
|
language: str
|
||||||
|
region: str
|
||||||
traits: _traits.EngineTraits
|
traits: _traits.EngineTraits
|
||||||
|
|
||||||
# from searx.engines.ENGINE_DEFAULT_ARGS
|
# from searx.engines.ENGINE_DEFAULT_ARGS
|
||||||
|
|||||||
@@ -14,40 +14,48 @@ import sys
|
|||||||
import copy
|
import copy
|
||||||
import os
|
import os
|
||||||
from os.path import realpath, dirname
|
from os.path import realpath, dirname
|
||||||
|
import warnings
|
||||||
|
|
||||||
import types
|
import types
|
||||||
import inspect
|
import inspect
|
||||||
|
import msgspec
|
||||||
|
|
||||||
from searx import logger, settings
|
from searx import logger, settings
|
||||||
from searx.utils import load_module
|
from searx.utils import load_module
|
||||||
|
from searx.data import ENGINE_TRAITS
|
||||||
if t.TYPE_CHECKING:
|
from searx.enginelib import Engine, EngineAbout
|
||||||
from searx.enginelib import Engine
|
|
||||||
|
|
||||||
logger = logger.getChild('engines')
|
logger = logger.getChild('engines')
|
||||||
ENGINE_DIR = dirname(realpath(__file__))
|
ENGINE_DIR = dirname(realpath(__file__))
|
||||||
|
|
||||||
# Defaults for the namespace of an engine module, see load_engine()
|
# Defaults for the namespace of an engine module, see load_engine()
|
||||||
ENGINE_DEFAULT_ARGS: dict[str, int | str | list[t.Any] | dict[str, t.Any] | bool] = {
|
ENGINE_DEFAULT_ARGS: dict[str, t.Any] = {
|
||||||
# Common options in the engine module
|
# Common options in the engine module
|
||||||
"engine_type": "online",
|
"engine_type": "online",
|
||||||
"paging": False,
|
"paging": False,
|
||||||
|
"max_page": 0,
|
||||||
"time_range_support": False,
|
"time_range_support": False,
|
||||||
"safesearch": False,
|
"safesearch": False,
|
||||||
|
"language_support": False,
|
||||||
# settings.yml
|
# settings.yml
|
||||||
"categories": ["general"],
|
"categories": ["general"],
|
||||||
|
"language": "",
|
||||||
|
"region": "",
|
||||||
"enable_http": False,
|
"enable_http": False,
|
||||||
"shortcut": "-",
|
"shortcut": "-",
|
||||||
"timeout": settings["outgoing"]["request_timeout"],
|
"timeout": settings["outgoing"]["request_timeout"],
|
||||||
"display_error_messages": True,
|
"display_error_messages": True,
|
||||||
"disabled": False,
|
"disabled": False,
|
||||||
"inactive": False,
|
"inactive": False,
|
||||||
"about": {},
|
"about": EngineAbout(),
|
||||||
"using_tor_proxy": False,
|
"using_tor_proxy": False,
|
||||||
"send_accept_language_header": True,
|
"send_accept_language_header": True,
|
||||||
"tokens": [],
|
"tokens": [],
|
||||||
"max_page": 0,
|
"weight": 1.0,
|
||||||
}
|
}
|
||||||
|
"""Default values that are set in an engine of type *module*, please compare
|
||||||
|
with the class :py:obj:`searx.enginelib.Engine`."""
|
||||||
|
|
||||||
# set automatically when an engine does not have any tab category
|
# set automatically when an engine does not have any tab category
|
||||||
DEFAULT_CATEGORY = 'other'
|
DEFAULT_CATEGORY = 'other'
|
||||||
|
|
||||||
@@ -177,14 +185,41 @@ def set_loggers(engine: "Engine|types.ModuleType", engine_name: str):
|
|||||||
|
|
||||||
|
|
||||||
def update_engine_attributes(engine: "Engine | types.ModuleType", engine_data: dict[str, t.Any]):
|
def update_engine_attributes(engine: "Engine | types.ModuleType", engine_data: dict[str, t.Any]):
|
||||||
|
# pylint: disable=too-many-branches
|
||||||
|
|
||||||
# set engine attributes from engine_data
|
# set engine attributes from engine_data
|
||||||
|
kvargs: dict[str, t.Any]
|
||||||
|
if isinstance(engine.about, EngineAbout):
|
||||||
|
kvargs = {**msgspec.to_builtins(engine.about), **engine_data.get("about", {})}
|
||||||
|
else:
|
||||||
|
kvargs = {**engine.about, **engine_data.get("about", {})}
|
||||||
|
|
||||||
|
try:
|
||||||
|
engine.about = EngineAbout(**kvargs)
|
||||||
|
except TypeError as exc:
|
||||||
|
raise TypeError(
|
||||||
|
f"engine '{engine_data['name']}' ({engine_data['engine']}) - in the about section --> {exc}"
|
||||||
|
) from exc
|
||||||
|
|
||||||
|
# warn about deprecated engine settings
|
||||||
|
|
||||||
|
if engine.about.language:
|
||||||
|
if hasattr(engine, "language") and not engine.language:
|
||||||
|
engine.language = engine.about.language
|
||||||
|
warnings.warn(
|
||||||
|
f"engine '{engine_data['name']}' ({engine_data['engine']})"
|
||||||
|
f" - migrate engine.about.language to engine.language!",
|
||||||
|
DeprecationWarning,
|
||||||
|
2,
|
||||||
|
)
|
||||||
|
|
||||||
for param_name, param_value in engine_data.items():
|
for param_name, param_value in engine_data.items():
|
||||||
|
if param_name == "about":
|
||||||
|
continue
|
||||||
if param_name == 'categories':
|
if param_name == 'categories':
|
||||||
if isinstance(param_value, str):
|
if isinstance(param_value, str):
|
||||||
param_value = list(map(str.strip, param_value.split(',')))
|
param_value = list(map(str.strip, param_value.split(',')))
|
||||||
engine.categories = param_value # type: ignore
|
engine.categories = param_value # type: ignore
|
||||||
elif hasattr(engine, 'about') and param_name == 'about':
|
|
||||||
engine.about = {**engine.about, **engine_data['about']} # type: ignore
|
|
||||||
else:
|
else:
|
||||||
setattr(engine, param_name, param_value)
|
setattr(engine, param_name, param_value)
|
||||||
|
|
||||||
@@ -193,6 +228,9 @@ def update_engine_attributes(engine: "Engine | types.ModuleType", engine_data: d
|
|||||||
if not hasattr(engine, arg_name):
|
if not hasattr(engine, arg_name):
|
||||||
setattr(engine, arg_name, copy.deepcopy(arg_value))
|
setattr(engine, arg_name, copy.deepcopy(arg_value))
|
||||||
|
|
||||||
|
if ENGINE_TRAITS.get(engine.name, {}).get("languages") and not engine.language_support:
|
||||||
|
raise ValueError(f"engine '{engine.name}' ({engine_data['engine']}) language_support should be set to True")
|
||||||
|
|
||||||
|
|
||||||
def update_attributes_for_tor(engine: "Engine | types.ModuleType"):
|
def update_attributes_for_tor(engine: "Engine | types.ModuleType"):
|
||||||
if using_tor_proxy(engine) and hasattr(engine, 'onion_url'):
|
if using_tor_proxy(engine) and hasattr(engine, 'onion_url'):
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Engine Configuration
|
# Engine Configuration
|
||||||
categories = ["videos"]
|
categories = ["videos"]
|
||||||
paging = True
|
paging = True
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
# Base URL
|
# Base URL
|
||||||
base_url = "https://www.acfun.cn"
|
base_url = "https://www.acfun.cn"
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ about: dict[str, t.Any] = {
|
|||||||
# engine dependent config
|
# engine dependent config
|
||||||
categories = ["files", "books"]
|
categories = ["files", "books"]
|
||||||
paging: bool = True
|
paging: bool = True
|
||||||
|
language_support = True
|
||||||
|
|
||||||
# search-url
|
# search-url
|
||||||
base_url: list[str] | str = []
|
base_url: list[str] | str = []
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ about = {
|
|||||||
'use_official_api': False,
|
'use_official_api': False,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'results': 'HTML',
|
'results': 'HTML',
|
||||||
'language': 'it',
|
|
||||||
}
|
}
|
||||||
|
language = "it"
|
||||||
|
|
||||||
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
|
|||||||
@@ -1,210 +0,0 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
"""AOL supports WEB, image, and video search. Internally, it uses the Bing
|
|
||||||
index.
|
|
||||||
|
|
||||||
AOL doesn't seem to support setting the language via request parameters, instead
|
|
||||||
the results are based on the URL. For example, there is
|
|
||||||
|
|
||||||
- `search.aol.com <https://search.aol.com>`_ for English results
|
|
||||||
- `suche.aol.de <https://suche.aol.de>`_ for German results
|
|
||||||
|
|
||||||
However, AOL offers its services only in a few regions:
|
|
||||||
|
|
||||||
- en-US: search.aol.com
|
|
||||||
- de-DE: suche.aol.de
|
|
||||||
- fr-FR: recherche.aol.fr
|
|
||||||
- en-GB: search.aol.co.uk
|
|
||||||
- en-CA: search.aol.ca
|
|
||||||
|
|
||||||
In order to still offer sufficient support for language and region, the `search
|
|
||||||
keywords`_ known from Bing, ``language`` and ``loc`` (region), are added to the
|
|
||||||
search term (AOL is basically just a proxy for Bing).
|
|
||||||
|
|
||||||
.. _search keywords:
|
|
||||||
https://support.microsoft.com/en-us/topic/advanced-search-keywords-ea595928-5d63-4a0b-9c6b-0b769865e78a
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
from urllib.parse import urlencode, unquote_plus
|
|
||||||
import typing as t
|
|
||||||
|
|
||||||
from lxml import html
|
|
||||||
from dateutil import parser
|
|
||||||
|
|
||||||
from searx.result_types import EngineResults
|
|
||||||
from searx.utils import eval_xpath_list, eval_xpath, extract_text
|
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
|
||||||
from searx.extended_types import SXNG_Response
|
|
||||||
from searx.search.processors import OnlineParams
|
|
||||||
|
|
||||||
about = {
|
|
||||||
"website": "https://www.aol.com",
|
|
||||||
"wikidata_id": "Q27585",
|
|
||||||
"official_api_documentation": None,
|
|
||||||
"use_official_api": False,
|
|
||||||
"require_api_key": False,
|
|
||||||
"results": "HTML",
|
|
||||||
}
|
|
||||||
|
|
||||||
categories = ["general"]
|
|
||||||
search_type = "search" # supported: search, image, video
|
|
||||||
|
|
||||||
paging = True
|
|
||||||
safesearch = True
|
|
||||||
time_range_support = True
|
|
||||||
results_per_page = 10
|
|
||||||
|
|
||||||
|
|
||||||
base_url = "https://search.aol.com"
|
|
||||||
time_range_map = {"day": "1d", "week": "1w", "month": "1m", "year": "1y"}
|
|
||||||
safesearch_map = {0: "p", 1: "r", 2: "i"}
|
|
||||||
|
|
||||||
enable_http2 = False
|
|
||||||
|
|
||||||
|
|
||||||
def init(_):
|
|
||||||
if search_type not in ("search", "image", "video"):
|
|
||||||
raise ValueError(f"unsupported search type {search_type}")
|
|
||||||
|
|
||||||
|
|
||||||
def request(query: str, params: "OnlineParams") -> None:
|
|
||||||
|
|
||||||
language, region = (params["searxng_locale"].split("-") + [None])[:2]
|
|
||||||
if language and language != "all":
|
|
||||||
query = f"{query} language:{language}"
|
|
||||||
if region:
|
|
||||||
query = f"{query} loc:{region}"
|
|
||||||
|
|
||||||
args: dict[str, str | int | None] = {
|
|
||||||
"q": query,
|
|
||||||
"b": params["pageno"] * results_per_page + 1, # page is 1-indexed
|
|
||||||
"pz": results_per_page,
|
|
||||||
}
|
|
||||||
|
|
||||||
if params["time_range"]:
|
|
||||||
args["fr2"] = "time"
|
|
||||||
args["age"] = params["time_range"]
|
|
||||||
else:
|
|
||||||
args["fr2"] = "sb-top-search"
|
|
||||||
|
|
||||||
params["cookies"]["sB"] = f"vm={safesearch_map[params['safesearch']]}"
|
|
||||||
params["url"] = f"{base_url}/aol/{search_type}?{urlencode(args)}"
|
|
||||||
logger.debug(params)
|
|
||||||
|
|
||||||
|
|
||||||
def _deobfuscate_url(obfuscated_url: str) -> str | None:
|
|
||||||
# URL looks like "https://search.aol.com/click/_ylt=AwjFSDjd;_ylu=JfsdjDFd/RV=2/RE=1774058166/RO=10/RU=https%3a%2f%2fen.wikipedia.org%2fwiki%2fTree/RK=0/RS=BP2CqeMLjscg4n8cTmuddlEQA2I-" # pylint: disable=line-too-long
|
|
||||||
if not obfuscated_url:
|
|
||||||
return None
|
|
||||||
|
|
||||||
for part in obfuscated_url.split("/"):
|
|
||||||
if part.startswith("RU="):
|
|
||||||
return unquote_plus(part[3:])
|
|
||||||
# pattern for de-obfuscating URL not found, fall back to Yahoo's tracking link
|
|
||||||
return obfuscated_url
|
|
||||||
|
|
||||||
|
|
||||||
def _general_results(doc: html.HtmlElement) -> EngineResults:
|
|
||||||
res = EngineResults()
|
|
||||||
|
|
||||||
for result in eval_xpath_list(doc, "//div[@id='web']//ol/li[not(contains(@class, 'first'))]"):
|
|
||||||
obfuscated_url = extract_text(eval_xpath(result, ".//h3/a/@href"))
|
|
||||||
if not obfuscated_url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
url = _deobfuscate_url(obfuscated_url)
|
|
||||||
if not url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
res.add(
|
|
||||||
res.types.MainResult(
|
|
||||||
url=url,
|
|
||||||
title=extract_text(eval_xpath(result, ".//h3/a")) or "",
|
|
||||||
content=extract_text(eval_xpath(result, ".//div[contains(@class, 'compText')]")) or "",
|
|
||||||
thumbnail=extract_text(eval_xpath(result, ".//a[contains(@class, 'thm')]/img/@data-src")) or "",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
def _video_results(doc: html.HtmlElement) -> EngineResults:
|
|
||||||
res = EngineResults()
|
|
||||||
|
|
||||||
for result in eval_xpath_list(doc, "//div[contains(@class, 'results')]//ol/li"):
|
|
||||||
obfuscated_url = extract_text(eval_xpath(result, ".//a/@href"))
|
|
||||||
if not obfuscated_url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
url = _deobfuscate_url(obfuscated_url)
|
|
||||||
if not url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
published_date_raw = extract_text(eval_xpath(result, ".//div[contains(@class, 'v-age')]"))
|
|
||||||
try:
|
|
||||||
published_date = parser.parse(published_date_raw or "")
|
|
||||||
except parser.ParserError:
|
|
||||||
published_date = None
|
|
||||||
|
|
||||||
res.add(
|
|
||||||
res.types.LegacyResult(
|
|
||||||
{
|
|
||||||
"template": "videos.html",
|
|
||||||
"url": url,
|
|
||||||
"title": extract_text(eval_xpath(result, ".//h3")),
|
|
||||||
"content": extract_text(eval_xpath(result, ".//div[contains(@class, 'compText')]")),
|
|
||||||
"thumbnail": extract_text(eval_xpath(result, ".//img[contains(@class, 'thm')]/@src")),
|
|
||||||
"length": extract_text(eval_xpath(result, ".//span[contains(@class, 'v-time')]")),
|
|
||||||
"publishedDate": published_date,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
def _image_results(doc: html.HtmlElement) -> EngineResults:
|
|
||||||
res = EngineResults()
|
|
||||||
|
|
||||||
for result in eval_xpath_list(doc, "//section[@id='results']//ul/li"):
|
|
||||||
obfuscated_url = extract_text(eval_xpath(result, "./a/@href"))
|
|
||||||
if not obfuscated_url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
url = _deobfuscate_url(obfuscated_url)
|
|
||||||
if not url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
res.add(
|
|
||||||
res.types.LegacyResult(
|
|
||||||
{
|
|
||||||
"template": "images.html",
|
|
||||||
# results don't have an extra URL, only the image source
|
|
||||||
"url": url,
|
|
||||||
"title": extract_text(eval_xpath(result, ".//a/@aria-label")),
|
|
||||||
"thumbnail_src": extract_text(eval_xpath(result, ".//img/@src")),
|
|
||||||
"img_src": url,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
def response(resp: "SXNG_Response") -> EngineResults:
|
|
||||||
doc = html.fromstring(resp.text)
|
|
||||||
|
|
||||||
match search_type:
|
|
||||||
case "search":
|
|
||||||
results = _general_results(doc)
|
|
||||||
case "image":
|
|
||||||
results = _image_results(doc)
|
|
||||||
case "video":
|
|
||||||
results = _video_results(doc)
|
|
||||||
case _:
|
|
||||||
raise ValueError("unsupported search type")
|
|
||||||
|
|
||||||
for suggestion in eval_xpath_list(doc, ".//ol[contains(@class, 'searchRightBottom')]//table//a"):
|
|
||||||
results.add(results.types.LegacyResult({"suggestion": extract_text(suggestion)}))
|
|
||||||
|
|
||||||
return results
|
|
||||||
@@ -35,6 +35,7 @@ about = {
|
|||||||
categories = ["it", "software wikis"]
|
categories = ["it", "software wikis"]
|
||||||
paging = True
|
paging = True
|
||||||
main_wiki = "wiki.archlinux.org"
|
main_wiki = "wiki.archlinux.org"
|
||||||
|
language_support = True
|
||||||
|
|
||||||
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ about = {
|
|||||||
"use_official_api": True,
|
"use_official_api": True,
|
||||||
"require_api_key": True,
|
"require_api_key": True,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
"language": "en",
|
|
||||||
}
|
}
|
||||||
|
language = "en"
|
||||||
|
|
||||||
CACHE: EngineCache
|
CACHE: EngineCache
|
||||||
"""Persistent (SQLite) key/value cache that deletes its values after ``expire``
|
"""Persistent (SQLite) key/value cache that deletes its values after ``expire``
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
paging = True
|
paging = True
|
||||||
categories = []
|
categories = []
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ about = {
|
|||||||
categories = ["general", "social media"]
|
categories = ["general", "social media"]
|
||||||
paging = True
|
paging = True
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
|
language_support = True
|
||||||
|
|
||||||
base_url = "https://boardreader.com"
|
base_url = "https://boardreader.com"
|
||||||
time_range_map = {"day": "1", "week": "7", "month": "30", "year": "365"}
|
time_range_map = {"day": "1", "week": "7", "month": "30", "year": "365"}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ about = {
|
|||||||
'use_official_api': False,
|
'use_official_api': False,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'results': 'JSON',
|
'results': 'JSON',
|
||||||
'language': 'de',
|
|
||||||
}
|
}
|
||||||
|
language = "de"
|
||||||
|
|
||||||
paging = True
|
paging = True
|
||||||
categories = ['general']
|
categories = ['general']
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Chatnoir is an open source search engine developed by Webis, a network of
|
||||||
|
researchers from the universities of Weimar, Halle and Leipzig. It supports
|
||||||
|
different different text corpora as indexes, e.g. CommonCrawl. See its
|
||||||
|
`announcement`_ for more information.
|
||||||
|
|
||||||
|
.. _announcement : https://groups.google.com/g/common-crawl/c/3o2dOHpeRxo/m/H2Osqz9dAAAJ
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
|
||||||
|
from searx.exceptions import SearxEngineAPIException
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.network import get, post
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.utils import html_to_text
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://www.chatnoir.eu",
|
||||||
|
"official_api_documentation": "https://www.chatnoir.eu/docs/api-general",
|
||||||
|
"use_official_api": True,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
|
||||||
|
base_url = "https://www.chatnoir.eu"
|
||||||
|
categories = ["general"]
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
page_size = 10
|
||||||
|
|
||||||
|
api_key = ""
|
||||||
|
"""You can optionally provide your own API key here. This one will then be used
|
||||||
|
instead of scraping an API key."""
|
||||||
|
|
||||||
|
search_index = "cw22"
|
||||||
|
"""Search index to browse in. See `the API documentation
|
||||||
|
<https://www.chatnoir.eu/docs/api-general>`_ for a full list."""
|
||||||
|
|
||||||
|
|
||||||
|
def _obtain_api_key() -> tuple[str, str, str]:
|
||||||
|
home_resp = get(base_url)
|
||||||
|
if not home_resp.ok:
|
||||||
|
raise SearxEngineAPIException("failed to obtain api key")
|
||||||
|
csrf_token = home_resp.cookies["csrftoken"]
|
||||||
|
|
||||||
|
token_resp = post(
|
||||||
|
"https://www.chatnoir.eu/?init",
|
||||||
|
headers={
|
||||||
|
"Referer": f"{base_url}/",
|
||||||
|
"X-Requested-With": "XMLHttpRequest",
|
||||||
|
"X-Csrf-Token": csrf_token,
|
||||||
|
},
|
||||||
|
cookies=home_resp.cookies,
|
||||||
|
)
|
||||||
|
if not token_resp.ok:
|
||||||
|
raise SearxEngineAPIException("failed to obtain api key")
|
||||||
|
session_id = token_resp.cookies["sessionid"]
|
||||||
|
scraped_api_key = token_resp.json()["token"]["token"]
|
||||||
|
|
||||||
|
return csrf_token, session_id, scraped_api_key
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams"):
|
||||||
|
if api_key:
|
||||||
|
# use user-provided API key instead of scraping one
|
||||||
|
headers = {
|
||||||
|
"Authorization": f"Bearer {api_key}",
|
||||||
|
}
|
||||||
|
|
||||||
|
params["headers"].update(headers)
|
||||||
|
else:
|
||||||
|
csrf_token, session_id, scraped_api_key = _obtain_api_key()
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Authorization": f"Bearer {scraped_api_key}",
|
||||||
|
"X-Csrf-Token": csrf_token,
|
||||||
|
}
|
||||||
|
|
||||||
|
params["headers"].update(headers)
|
||||||
|
params["cookies"] = {"csrftoken": session_id, "sessionid": session_id}
|
||||||
|
|
||||||
|
params["url"] = f"{base_url}/api/v1/_search"
|
||||||
|
params["method"] = "POST"
|
||||||
|
|
||||||
|
json_data = {
|
||||||
|
"query": query,
|
||||||
|
"index": [
|
||||||
|
search_index,
|
||||||
|
],
|
||||||
|
"from": (params["pageno"] - 1) * page_size,
|
||||||
|
"size": page_size,
|
||||||
|
"_extended_meta": True,
|
||||||
|
}
|
||||||
|
params["json"] = json_data
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
results = resp.json()["results"]
|
||||||
|
|
||||||
|
for result in results:
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["target_uri"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
content=html_to_text(result["snippet"]),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -10,8 +10,8 @@ about = {
|
|||||||
'use_official_api': False,
|
'use_official_api': False,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'results': 'JSON',
|
'results': 'JSON',
|
||||||
'language': 'de',
|
|
||||||
}
|
}
|
||||||
|
language = "de"
|
||||||
|
|
||||||
paging = True
|
paging = True
|
||||||
categories = []
|
categories = []
|
||||||
|
|||||||
@@ -70,13 +70,13 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paging = True
|
paging = True
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
results_per_page = 10
|
results_per_page = 10
|
||||||
categories = []
|
categories = []
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
ChinasoCategoryType = t.Literal['news', 'videos', 'images']
|
ChinasoCategoryType = t.Literal['news', 'videos', 'images']
|
||||||
"""ChinaSo supports news, videos, images search.
|
"""ChinaSo supports news, videos, images search.
|
||||||
@@ -156,6 +156,13 @@ def response(resp):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise SearxEngineAPIException(f"Invalid response: {e}") from e
|
raise SearxEngineAPIException(f"Invalid response: {e}") from e
|
||||||
|
|
||||||
|
# Upstream returns {'status': 0, 'msg': 'empty result', 'data': {}} when there
|
||||||
|
# are no results; this is a valid empty result rather than an API error.
|
||||||
|
if not isinstance(data, dict) or "data" not in data:
|
||||||
|
raise SearxEngineAPIException("Invalid response")
|
||||||
|
if not data["data"]:
|
||||||
|
return []
|
||||||
|
|
||||||
parsers = {'news': parse_news, 'images': parse_images, 'videos': parse_videos}
|
parsers = {'news': parse_news, 'images': parse_images, 'videos': parse_videos}
|
||||||
|
|
||||||
return parsers[chinaso_category](data)
|
return parsers[chinaso_category](data)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ categories = ["videos"]
|
|||||||
paging = True
|
paging = True
|
||||||
page_size = 10
|
page_size = 10
|
||||||
|
|
||||||
|
language_support = True
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
time_delta_dict = {
|
time_delta_dict = {
|
||||||
"day": timedelta(days=1),
|
"day": timedelta(days=1),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import typing as t
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from searx.result_types import EngineResults
|
from searx.result_types import EngineResults
|
||||||
from searx.enginelib import EngineCache
|
from searx.enginelib import EngineCache, EngineAbout
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
if t.TYPE_CHECKING:
|
||||||
from searx.search.processors import RequestParams
|
from searx.search.processors import RequestParams
|
||||||
@@ -35,13 +35,11 @@ categories = ["general"]
|
|||||||
disabled = True
|
disabled = True
|
||||||
timeout = 2.0
|
timeout = 2.0
|
||||||
|
|
||||||
about = {
|
language = "en"
|
||||||
"wikidata_id": None,
|
about = EngineAbout(
|
||||||
"official_api_documentation": None,
|
results="JSON",
|
||||||
"use_official_api": False,
|
description="Demo offline engine Engine with results in the English language.",
|
||||||
"require_api_key": False,
|
)
|
||||||
"results": "JSON",
|
|
||||||
}
|
|
||||||
|
|
||||||
# if there is a need for globals, use a leading underline
|
# if there is a need for globals, use a leading underline
|
||||||
_my_offline_engine: str = ""
|
_my_offline_engine: str = ""
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import typing as t
|
|||||||
|
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
from searx.result_types import EngineResults
|
from searx.result_types import EngineResults
|
||||||
|
from searx.enginelib import EngineAbout
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
if t.TYPE_CHECKING:
|
||||||
from searx.extended_types import SXNG_Response
|
from searx.extended_types import SXNG_Response
|
||||||
@@ -43,14 +44,14 @@ page_size = 20
|
|||||||
search_api = "https://api.artic.edu/api/v1/artworks/search"
|
search_api = "https://api.artic.edu/api/v1/artworks/search"
|
||||||
image_api = "https://www.artic.edu/iiif/2/"
|
image_api = "https://www.artic.edu/iiif/2/"
|
||||||
|
|
||||||
about = {
|
about = EngineAbout(
|
||||||
"website": "https://www.artic.edu",
|
website="https://www.artic.edu",
|
||||||
"wikidata_id": "Q239303",
|
wikidata_id="Q239303",
|
||||||
"official_api_documentation": "http://api.artic.edu/docs/",
|
official_api_documentation="http://api.artic.edu/docs/",
|
||||||
"use_official_api": True,
|
use_official_api=True,
|
||||||
"require_api_key": False,
|
require_api_key=False,
|
||||||
"results": "JSON",
|
results="JSON",
|
||||||
}
|
)
|
||||||
|
|
||||||
|
|
||||||
# if there is a need for globals, use a leading underline
|
# if there is a need for globals, use a leading underline
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ about = {
|
|||||||
'use_official_api': False,
|
'use_official_api': False,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'results': 'HTML',
|
'results': 'HTML',
|
||||||
'language': 'de',
|
|
||||||
}
|
}
|
||||||
|
language = "de"
|
||||||
|
|
||||||
categories = []
|
categories = []
|
||||||
paging = True
|
paging = True
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Dogpile is a metasearch engine by the American advertising company `System1`_.
|
||||||
|
|
||||||
|
.. _System1: https://system1.com/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
import html
|
||||||
|
|
||||||
|
from searx.utils import format_duration, html_to_text, humanize_number
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://www.dogpile.com",
|
||||||
|
"wikidata_id": "Q3595363",
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
safesearch = True
|
||||||
|
|
||||||
|
categories = ["general"]
|
||||||
|
dogpile_categ = "search"
|
||||||
|
"""Category to search in. Can be either "search", "images", "videos" or "news"."""
|
||||||
|
|
||||||
|
|
||||||
|
base_url = "https://www.dogpile.com"
|
||||||
|
safe_search_map = {0: "none", 1: "moderate", 2: "heavy"}
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if dogpile_categ not in ("search", "images", "videos", "news"):
|
||||||
|
raise ValueError("invalid search type: %s" % dogpile_categ)
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams"):
|
||||||
|
params["url"] = f"{base_url}/api/{dogpile_categ}"
|
||||||
|
params["method"] = "POST"
|
||||||
|
params["json"] = {"q": query, "qadf": safe_search_map[params["safesearch"]], "page": params["pageno"]}
|
||||||
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response"):
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
json_resp = resp.json()
|
||||||
|
|
||||||
|
for result in json_resp["results"]:
|
||||||
|
if dogpile_categ == "search":
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["clickUrl"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
content=html_to_text(result["description"]),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif dogpile_categ == "news":
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["clickUrl"],
|
||||||
|
title=html_to_text(html.unescape(result["title"])),
|
||||||
|
content=html_to_text(html.unescape(result["description"])),
|
||||||
|
thumbnail=result["thumbnailUrl"],
|
||||||
|
publishedDate=datetime.fromtimestamp(result["date"], tz=timezone.utc),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif dogpile_categ == "videos":
|
||||||
|
res.add(
|
||||||
|
res.types.LegacyResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=result["clickUrl"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
content=html_to_text(result["description"]),
|
||||||
|
thumbnail=result["thumbnailUrl"],
|
||||||
|
publishedDate=datetime.fromisoformat(result["publishDate"]),
|
||||||
|
length=format_duration(result["duration"]),
|
||||||
|
views=humanize_number(result["viewCount"]),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif dogpile_categ == "images":
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=result["altClickUrl"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
content=html_to_text(result["description"]),
|
||||||
|
img_src=result["clickUrl"],
|
||||||
|
thumbnail_src=result["thumbnailUrl"],
|
||||||
|
resolution=f"{result['width']}x{result['height']}",
|
||||||
|
img_format=result["format"],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -203,6 +203,7 @@ about: dict[str, str | bool] = {
|
|||||||
categories: list[str] = ["general", "web"]
|
categories: list[str] = ["general", "web"]
|
||||||
paging: bool = True
|
paging: bool = True
|
||||||
time_range_support: bool = True
|
time_range_support: bool = True
|
||||||
|
language_support = True
|
||||||
safesearch: bool = True
|
safesearch: bool = True
|
||||||
"""DDG-lite: user can't select but the results are filtered."""
|
"""DDG-lite: user can't select but the results are filtered."""
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON (site requires js to get images)",
|
"results": "JSON (site requires js to get images)",
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
|
|
||||||
# engine dependent config
|
# engine dependent config
|
||||||
categories = []
|
categories = []
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
|
|
||||||
# engine dependent config
|
# engine dependent config
|
||||||
categories = ["weather"]
|
categories = ["weather"]
|
||||||
|
|||||||
@@ -140,7 +140,9 @@ def response(resp: "SXNG_Response"):
|
|||||||
if "u" not in result:
|
if "u" not in result:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
res.add(res.types.MainResult(url=result["u"], title=result["t"], content=html_to_text(result["a"])))
|
res.add(
|
||||||
|
res.types.MainResult(url=result["u"], title=html_to_text(result["t"]), content=html_to_text(result["a"]))
|
||||||
|
)
|
||||||
|
|
||||||
# link to next page
|
# link to next page
|
||||||
next_page_path = res_json["results"][-1].get("n")
|
next_page_path = res_json["results"][-1].get("n")
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": 'HTML',
|
"results": 'HTML',
|
||||||
"language": 'de',
|
|
||||||
}
|
}
|
||||||
|
language = "de"
|
||||||
|
|
||||||
categories = ['dictionaries']
|
categories = ['dictionaries']
|
||||||
paging = True
|
paging = True
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ about = {
|
|||||||
'official_api_documentation': 'https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html',
|
'official_api_documentation': 'https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html',
|
||||||
'use_official_api': True,
|
'use_official_api': True,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'format': 'JSON',
|
"results": "JSON",
|
||||||
}
|
}
|
||||||
|
|
||||||
base_url = 'http://localhost:9200'
|
base_url = 'http://localhost:9200'
|
||||||
|
|||||||
@@ -0,0 +1,118 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""FindFiles.net_ is a Germany-based file search engine.
|
||||||
|
|
||||||
|
FindFiles.net_ is a specialized file search engine designed to help you search
|
||||||
|
files online with precision. Unlike traditional search engines that mainly index
|
||||||
|
web pages, FindFiles focuses on finding real files on the internet - including
|
||||||
|
PDFs, documents, archives, videos, datasets, and more.
|
||||||
|
|
||||||
|
.. _FindFiles.net: https://findfiles.net
|
||||||
|
"""
|
||||||
|
|
||||||
|
from os.path import basename
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
import typing as t
|
||||||
|
|
||||||
|
from lxml import html
|
||||||
|
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.utils import extract_text, eval_xpath, eval_xpath_list
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from extended_types import SXNG_Response
|
||||||
|
from search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://findfiles.net",
|
||||||
|
"wikidata_id": None,
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "HTML",
|
||||||
|
}
|
||||||
|
|
||||||
|
base_url = "https://findfiles.net"
|
||||||
|
categories = ["files"]
|
||||||
|
paging = True
|
||||||
|
safeserach = True
|
||||||
|
|
||||||
|
safesearch_map = {
|
||||||
|
0: "contentguard.off",
|
||||||
|
1: "contentguard.moderate",
|
||||||
|
2: "contentguard.strict",
|
||||||
|
}
|
||||||
|
|
||||||
|
FindFilesCategory = t.Literal[
|
||||||
|
"all",
|
||||||
|
"document",
|
||||||
|
"text",
|
||||||
|
"image",
|
||||||
|
"audio",
|
||||||
|
"video",
|
||||||
|
]
|
||||||
|
FINDFILES_CATEGORIES = t.get_args(FindFilesCategory)
|
||||||
|
|
||||||
|
findfiles_categ: FindFilesCategory = "all"
|
||||||
|
"""Category to search in."""
|
||||||
|
|
||||||
|
|
||||||
|
def setup(_: dict[str, t.Any]) -> bool:
|
||||||
|
if findfiles_categ not in FINDFILES_CATEGORIES:
|
||||||
|
raise ValueError("invalid category: %s" % findfiles_categ)
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
args = {
|
||||||
|
"query": query,
|
||||||
|
"contentguard": safesearch_map[params["safesearch"]],
|
||||||
|
"page": params["pageno"],
|
||||||
|
}
|
||||||
|
# the language in the path doesn't change anything about the results, it
|
||||||
|
# only changes the UI
|
||||||
|
params["url"] = f"{base_url}/en/serp/{findfiles_categ}/?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
dom = html.fromstring(resp.text)
|
||||||
|
if findfiles_categ == "image":
|
||||||
|
for result in eval_xpath_list(
|
||||||
|
dom, "//div[contains(@class, 'image-mosaic')]/div[contains(@class, 'image-item')]"
|
||||||
|
):
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=extract_text(eval_xpath(result, ".//div[contains(@class, 'caption')]/a/@href")) or "",
|
||||||
|
title=extract_text(eval_xpath(result, ".//div[contains(@class, 'caption')]/a")) or "",
|
||||||
|
thumbnail_src=extract_text(eval_xpath(result, ".//img/@src")) or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif findfiles_categ == "video":
|
||||||
|
for result in eval_xpath_list(
|
||||||
|
dom, "//div[contains(@class, 'video-mosaic')]/div[contains(@class, 'video-item')]"
|
||||||
|
):
|
||||||
|
video_src = extract_text(eval_xpath(result, ".//video/@src")) or ""
|
||||||
|
res.add(
|
||||||
|
res.types.LegacyResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=video_src,
|
||||||
|
title=extract_text(eval_xpath(result, ".//div[contains(@class, 'caption')]/span")) or "",
|
||||||
|
iframe_src=video_src or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
for result in eval_xpath_list(dom, "//ol/li[contains(@class, 'result-item')]/article"):
|
||||||
|
filename = basename(extract_text(eval_xpath(result, ".//h3")) or "")
|
||||||
|
res.add(
|
||||||
|
res.types.File(
|
||||||
|
url=extract_text(eval_xpath(result, ".//h3/a/@href")) or "",
|
||||||
|
title=filename,
|
||||||
|
content=" ".join(extract_text(el) or "" for el in eval_xpath_list(result, "./div/span")),
|
||||||
|
filename=filename,
|
||||||
|
size=extract_text(eval_xpath(result, "(.//span[@id])[1]")) or "",
|
||||||
|
embedded=extract_text(eval_xpath(result, ".//audio/@src")) or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -63,6 +63,7 @@ def response(resp: "SXNG_Response"):
|
|||||||
url=_fix_url(result["slug"]),
|
url=_fix_url(result["slug"]),
|
||||||
thumbnail_src=_fix_url(result["png"]),
|
thumbnail_src=_fix_url(result["png"]),
|
||||||
img_src=_fix_url(result["png512"]),
|
img_src=_fix_url(result["png512"]),
|
||||||
|
img_format="PNG",
|
||||||
author=result["team_name"],
|
author=result["team_name"],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ about = {
|
|||||||
'official_api_documentation': None,
|
'official_api_documentation': None,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'results': 'HTML',
|
'results': 'HTML',
|
||||||
'language': 'de',
|
|
||||||
}
|
}
|
||||||
|
language = "de"
|
||||||
paging = True
|
paging = True
|
||||||
categories = ['shopping']
|
categories = ['shopping']
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Giphy (images)"""
|
||||||
|
|
||||||
|
import random
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
import re
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
|
||||||
|
from lxml import html
|
||||||
|
|
||||||
|
from searx.enginelib import EngineCache
|
||||||
|
from searx.exceptions import SearxEngineAPIException
|
||||||
|
from searx.network import get
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.result_types.image import ImageRef
|
||||||
|
from searx.utils import eval_xpath_list, humanize_bytes
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://giphy.com",
|
||||||
|
"wikidata_id": "Q17054335",
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
|
||||||
|
base_url = "https://giphy.com"
|
||||||
|
api_url = "https://api.giphy.com"
|
||||||
|
|
||||||
|
categories = ["images"]
|
||||||
|
paging = True
|
||||||
|
page_size = 15
|
||||||
|
|
||||||
|
GiphyCategs = t.Literal["gifs", "stickers", "clips"]
|
||||||
|
giphy_categ: GiphyCategs = "gifs"
|
||||||
|
"""Giphy category to search in."""
|
||||||
|
|
||||||
|
CACHE: EngineCache
|
||||||
|
"""Cache for storing the extracted api key."""
|
||||||
|
|
||||||
|
|
||||||
|
_GIPHY_API_KEY_RE = re.compile(r"[Aa]piKey\s*:\s*\"(\w+)\"")
|
||||||
|
|
||||||
|
|
||||||
|
def setup(engine_settings: dict[str, str]) -> bool:
|
||||||
|
if giphy_categ not in t.get_args(GiphyCategs):
|
||||||
|
raise ValueError("invalid category: %s" % giphy_categ)
|
||||||
|
|
||||||
|
global CACHE # pylint: disable=global-statement
|
||||||
|
CACHE = EngineCache(engine_settings["name"])
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def _get_api_key() -> str:
|
||||||
|
"""
|
||||||
|
Extract the Giphy API key from the JavaScript code. There are different API keys
|
||||||
|
(e.g. for mobile, desktop, ...), so we just pick a random one of these.
|
||||||
|
"""
|
||||||
|
cached = CACHE.get("api_key")
|
||||||
|
if cached:
|
||||||
|
return cached
|
||||||
|
|
||||||
|
homepage_resp = get(base_url)
|
||||||
|
homepage_doc = html.fromstring(homepage_resp.text)
|
||||||
|
|
||||||
|
for script_src in eval_xpath_list(homepage_doc, "//script[contains(@src, 'layout')]/@src"):
|
||||||
|
script_resp = get(base_url + script_src)
|
||||||
|
api_keys = _GIPHY_API_KEY_RE.findall(script_resp.text)
|
||||||
|
if api_keys:
|
||||||
|
api_key = random.choice(api_keys)
|
||||||
|
CACHE.set("api_key", api_key, expire=60 * 60 * 6) # 6 hours
|
||||||
|
return api_key
|
||||||
|
|
||||||
|
raise SearxEngineAPIException("failed to extract api keys")
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
args = {
|
||||||
|
"q": query,
|
||||||
|
"api_key": _get_api_key(),
|
||||||
|
"limit": page_size,
|
||||||
|
"offset": (params["pageno"] - 1) * page_size,
|
||||||
|
"type": giphy_categ,
|
||||||
|
}
|
||||||
|
params["url"] = f"{api_url}/v1/{giphy_categ}/search?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response"):
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
result: dict[str, t.Any]
|
||||||
|
for result in resp.json()["data"]:
|
||||||
|
img = result['images']['original']
|
||||||
|
formats = [
|
||||||
|
ImageRef(url=img["mp4"], subtype="mp4"), # type: ignore
|
||||||
|
ImageRef(url=img["webp"], subtype="webp"), # type: ignore
|
||||||
|
]
|
||||||
|
thumb = (
|
||||||
|
result["images"].get("downsized")
|
||||||
|
or result["images"].get("downsized_medium")
|
||||||
|
or result["images"].get("downsized_small")
|
||||||
|
or result["images"].get("downsized_large")
|
||||||
|
)
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
title=result["title"],
|
||||||
|
content=", ".join(result.get("tags", [])),
|
||||||
|
url=result["url"],
|
||||||
|
thumbnail_src=thumb.get("url") or img["url"],
|
||||||
|
img_src=img["url"],
|
||||||
|
resolution=f"{img['width']}x{img['height']}",
|
||||||
|
img_format="GIF",
|
||||||
|
formats=formats,
|
||||||
|
author=result["username"],
|
||||||
|
filesize=humanize_bytes(int(img["size"])),
|
||||||
|
source=result.get("source_tld") or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -57,6 +57,7 @@ max_page = 50
|
|||||||
.. _Google max 50 pages: https://github.com/searxng/searxng/issues/2982
|
.. _Google max 50 pages: https://github.com/searxng/searxng/issues/2982
|
||||||
"""
|
"""
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
|
language_support = True
|
||||||
safesearch = True
|
safesearch = True
|
||||||
|
|
||||||
time_range_dict = {"day": "d", "week": "w", "month": "m", "year": "y"}
|
time_range_dict = {"day": "d", "week": "w", "month": "m", "year": "y"}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ max_page = 50
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
|
language_support = True
|
||||||
safesearch = True
|
safesearch = True
|
||||||
|
|
||||||
filter_mapping = {0: 'images', 1: 'active', 2: 'active'}
|
filter_mapping = {0: 'images', 1: 'active', 2: 'active'}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ about = {
|
|||||||
categories = ["news"]
|
categories = ["news"]
|
||||||
paging = False
|
paging = False
|
||||||
time_range_support = False
|
time_range_support = False
|
||||||
|
language_support = True
|
||||||
|
|
||||||
# Google-News results are always *SafeSearch*. Option 'safesearch' is set to
|
# Google-News results are always *SafeSearch*. Option 'safesearch' is set to
|
||||||
# False here.
|
# False here.
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ about = {
|
|||||||
"use_official_api": True,
|
"use_official_api": True,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
"language": "it",
|
|
||||||
}
|
}
|
||||||
|
language = "it"
|
||||||
|
|
||||||
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": 'HTML',
|
"results": 'HTML',
|
||||||
"language": 'fr',
|
|
||||||
}
|
}
|
||||||
|
language = "fr"
|
||||||
|
|
||||||
# engine dependent config
|
# engine dependent config
|
||||||
categories = ['videos']
|
categories = ['videos']
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
language = "zh"
|
||||||
paging = True
|
paging = True
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
categories = ["videos"]
|
categories = ["videos"]
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""iseek_ is a search engine by the AI company Vantage Labs LLC,
|
||||||
|
that focuses on medical and educational applicances.
|
||||||
|
Although it's an AI company, it doesn't include any AI stuff in its results.
|
||||||
|
|
||||||
|
.. _iseek : https://www.iseek.ai/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import base64
|
||||||
|
from hashlib import sha256
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": 'https://www.iseek.com',
|
||||||
|
"wikidata_id": None,
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
categories = ["general"]
|
||||||
|
paging = True
|
||||||
|
|
||||||
|
base_url = "https://api.iseek.com"
|
||||||
|
page_size = 10
|
||||||
|
|
||||||
|
|
||||||
|
def _get_new_token(query: str, pageno: int) -> str:
|
||||||
|
"""Create a new ``qToken``. This reduced the time for fetching subsequent pages
|
||||||
|
from 4 seconds to 200ms when testing."""
|
||||||
|
# The website uses a random value as qToken for the first page. For our use case,
|
||||||
|
# it's easier if the qToken can be deterministically re-calculated based on the search query,
|
||||||
|
# so that we can the same result when calling _get_new_token for the second, third, ... page
|
||||||
|
#
|
||||||
|
# var qToken = Math.ceil(Math.random() * parseInt("ZZZZ", 36)).toString(36);
|
||||||
|
# while (qToken.length < 4) qToken = '0' + qToken;
|
||||||
|
# qToken = qToken + "_" + pageno
|
||||||
|
query_hash = sha256(query.encode()).digest()
|
||||||
|
hash_start = base64.b64encode(query_hash).decode()[0:4]
|
||||||
|
return f"{hash_start}_{pageno}"
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams"):
|
||||||
|
offset = (params["pageno"] - 1) * page_size
|
||||||
|
|
||||||
|
# always seems to find 20 results max
|
||||||
|
if offset >= 20:
|
||||||
|
params["url"] = None
|
||||||
|
return
|
||||||
|
|
||||||
|
args = {
|
||||||
|
"q": query,
|
||||||
|
"key": "core-web",
|
||||||
|
"num": str(page_size),
|
||||||
|
"off": offset,
|
||||||
|
"rSort": "__metasearch_score_d:desc",
|
||||||
|
# it supports many more fields, but none of them are really relevant
|
||||||
|
"names": "title_t,content_txt,url_s",
|
||||||
|
"qNames": "title_t",
|
||||||
|
"qToken": _get_new_token(query, params["pageno"]),
|
||||||
|
}
|
||||||
|
params["url"] = f"{base_url}/search?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
for group in resp.json()["data"]:
|
||||||
|
group: dict[str, t.Any]
|
||||||
|
for result in group["doclist"]["docs"]:
|
||||||
|
result: dict[str, str]
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["url_s"],
|
||||||
|
title=result["title_t"],
|
||||||
|
content="".join(result["content_txt"]),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -13,8 +13,8 @@ about = {
|
|||||||
"use_official_api": True,
|
"use_official_api": True,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": 'JSON',
|
"results": 'JSON',
|
||||||
"language": 'ja',
|
|
||||||
}
|
}
|
||||||
|
language = "ja"
|
||||||
|
|
||||||
categories = ['dictionaries']
|
categories = ['dictionaries']
|
||||||
paging = False
|
paging = False
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ from json import loads
|
|||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
from searx.utils import to_string, html_to_text
|
from searx.utils import to_string, html_to_text
|
||||||
from searx.network import raise_for_httperror
|
from searx.network import raise_for_httperror
|
||||||
|
from searx.enginelib import EngineAbout
|
||||||
|
|
||||||
|
about = EngineAbout()
|
||||||
|
|
||||||
search_url = None
|
search_url = None
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -0,0 +1,190 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Kagi_ is a paid, privacy-focused search engine.
|
||||||
|
|
||||||
|
Using it requires an API key. If you have a Kagi account, you can obtain an API
|
||||||
|
key in the `API portal`_.
|
||||||
|
|
||||||
|
To enable Kagi, add the following to the ``engines`` seciton of
|
||||||
|
``settings.yml``:
|
||||||
|
|
||||||
|
.. code:: yaml
|
||||||
|
|
||||||
|
- name: kagi
|
||||||
|
engine: kagi
|
||||||
|
categories: [general, web]
|
||||||
|
shortcut: kg
|
||||||
|
api_key: ""
|
||||||
|
kagi_categ: search
|
||||||
|
|
||||||
|
- name: kagi.news
|
||||||
|
engine: kagi
|
||||||
|
categories: [news, web]
|
||||||
|
shortcut: kgn
|
||||||
|
api_key: ""
|
||||||
|
kagi_categ: news
|
||||||
|
|
||||||
|
- name: kagi.images
|
||||||
|
engine: kagi
|
||||||
|
categories: [images, web]
|
||||||
|
shortcut: kgi
|
||||||
|
paging: false
|
||||||
|
api_key: ""
|
||||||
|
kagi_categ: images
|
||||||
|
|
||||||
|
- name: kagi.videos
|
||||||
|
engine: kagi
|
||||||
|
categories: [videos, web]
|
||||||
|
shortcut: kgv
|
||||||
|
api_key: ""
|
||||||
|
kagi_categ: videos
|
||||||
|
|
||||||
|
.. _Kagi: https://kagi.com
|
||||||
|
.. _Api Portal: https://help.kagi.com/kagi/api/overview.html
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
import html
|
||||||
|
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.utils import parse_duration_string
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
TimeRangeType = t.Literal["day", "week", "month", "year"]
|
||||||
|
about = {
|
||||||
|
"website": "https://kagi.com",
|
||||||
|
"wikidata_id": "Q26000117",
|
||||||
|
"official_api_documentation": "https://kagi.com/api/docs/openapi",
|
||||||
|
"use_official_api": True,
|
||||||
|
"require_api_key": True,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
"""All categories except the ``images`` category support paging."""
|
||||||
|
safesearch = True
|
||||||
|
time_range_support = True
|
||||||
|
|
||||||
|
categories = ["general"]
|
||||||
|
kagi_categ: t.Literal["search", "images", "news", "videos"] = "search"
|
||||||
|
"""Search category. Supported values: "search" (general), "images", "news", "videos"."""
|
||||||
|
|
||||||
|
base_url = "https://kagi.com"
|
||||||
|
|
||||||
|
safe_search_map = {0: False, 1: True, 2: True}
|
||||||
|
time_range_to_days_map: dict[TimeRangeType, int] = {"day": 1, "week": 7, "month": 30, "year": 365}
|
||||||
|
|
||||||
|
api_key = ""
|
||||||
|
"""Kagi API key. Required for using this engine."""
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if not api_key:
|
||||||
|
raise ValueError("api_key is required for using kagi")
|
||||||
|
|
||||||
|
if kagi_categ not in ("search", "images", "news", "videos"):
|
||||||
|
raise ValueError(f"Unsupported category: {kagi_categ}") # pyright: ignore[reportUnreachable]
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams"):
|
||||||
|
# According to the API docs, Kagi supports at maximum page 10
|
||||||
|
if params["pageno"] > 10:
|
||||||
|
return
|
||||||
|
|
||||||
|
params["headers"]["Authorization"] = f"Bearer {api_key}"
|
||||||
|
params["url"] = f"{base_url}/api/v1/search"
|
||||||
|
|
||||||
|
filters = {}
|
||||||
|
time_range = params.get("time_range")
|
||||||
|
if time_range:
|
||||||
|
# Kagi expects the minimum date to return results from as argument to `after`
|
||||||
|
time_period = timedelta(days=time_range_to_days_map[time_range])
|
||||||
|
oldest_result_date = datetime.now() - time_period
|
||||||
|
filters["after"] = oldest_result_date.strftime("%Y-%m-%d")
|
||||||
|
|
||||||
|
# there doesn't seem to be a list of languages anywhere,
|
||||||
|
# so we just assume that it supports all languages
|
||||||
|
|
||||||
|
filters["region"] = "no_region"
|
||||||
|
if params["searxng_locale"] != "all":
|
||||||
|
_locale = params["searxng_locale"].split("-")
|
||||||
|
if len(_locale) > 1:
|
||||||
|
filters["region"] = _locale[-1].lower()
|
||||||
|
|
||||||
|
args: dict[str, t.Any] = {
|
||||||
|
"query": query,
|
||||||
|
"page": params["pageno"],
|
||||||
|
"workflow": kagi_categ,
|
||||||
|
"safe_search": safe_search_map[params["safesearch"]],
|
||||||
|
"filters": filters,
|
||||||
|
}
|
||||||
|
|
||||||
|
params["method"] = "POST"
|
||||||
|
params["json"] = args
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
json_data: dict[str, t.Any] = resp.json()
|
||||||
|
|
||||||
|
if kagi_categ in ("images", "videos"):
|
||||||
|
# the JSON key is "image" for "images" and "video" for "videos"
|
||||||
|
json_results = json_data["data"][kagi_categ[:-1]]
|
||||||
|
else:
|
||||||
|
json_results = json_data["data"][kagi_categ]
|
||||||
|
|
||||||
|
for result in json_results:
|
||||||
|
published_date: datetime | None = None
|
||||||
|
if result.get("time"):
|
||||||
|
published_date = datetime.fromisoformat(result["time"])
|
||||||
|
|
||||||
|
if kagi_categ in ("search", "news"):
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["url"],
|
||||||
|
title=html.unescape(result["title"]),
|
||||||
|
content=html.unescape(result["snippet"]),
|
||||||
|
thumbnail=result.get("image", {}).get("url") or "",
|
||||||
|
publishedDate=published_date,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif kagi_categ == "images":
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=result["url"],
|
||||||
|
title=html.unescape(result.get("title")),
|
||||||
|
img_src=result.get("image", {}).get("url"),
|
||||||
|
resolution=f"{result['image']['width']}x{result['image']['height']}",
|
||||||
|
thumbnail_src=result.get("props", {}).get("thumbnail", {}).get("url"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif kagi_categ == "videos":
|
||||||
|
length: timedelta | None = None
|
||||||
|
if result["props"].get("duration"):
|
||||||
|
length = parse_duration_string(result["props"]["duration"])
|
||||||
|
|
||||||
|
res.add(
|
||||||
|
res.types.LegacyResult(
|
||||||
|
{
|
||||||
|
"template": "videos.html",
|
||||||
|
"url": result["url"],
|
||||||
|
"title": html.unescape(result["title"]),
|
||||||
|
"content": html.unescape(result["snippet"]),
|
||||||
|
"thumbnail": result.get("image", {}).get("url"),
|
||||||
|
"publishedDate": published_date,
|
||||||
|
"author": result["props"].get("creator_name"),
|
||||||
|
"length": length,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
for suggestion in json_data["data"].get("related_search", []):
|
||||||
|
res.add(res.types.LegacyResult({"suggestion": suggestion["title"]}))
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -0,0 +1,210 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Luxxle_ is an American search engine focusing on providing "unbiased"
|
||||||
|
results.
|
||||||
|
|
||||||
|
.. _Luxxle: https://luxxle.com
|
||||||
|
"""
|
||||||
|
|
||||||
|
from json import dumps
|
||||||
|
from urllib.parse import quote_plus, unquote_plus
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from lxml import html
|
||||||
|
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.network import get
|
||||||
|
from searx.utils import (
|
||||||
|
extr,
|
||||||
|
gen_useragent,
|
||||||
|
eval_xpath_list,
|
||||||
|
extract_text,
|
||||||
|
eval_xpath,
|
||||||
|
parse_duration_string,
|
||||||
|
ElementType,
|
||||||
|
)
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://luxxle.com",
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "HTML",
|
||||||
|
}
|
||||||
|
|
||||||
|
categories = []
|
||||||
|
safeseach = True
|
||||||
|
|
||||||
|
base_url = "https://luxxle.com"
|
||||||
|
|
||||||
|
luxxle_categ = "search"
|
||||||
|
"""Supported categories: "search", "news", "images", "videos"."""
|
||||||
|
|
||||||
|
# otherwise all requests get blocked (http2-fingerprinted probably)
|
||||||
|
enable_http2 = False
|
||||||
|
|
||||||
|
|
||||||
|
safe_search_map = {0: "Off", 1: "Moderate", 2: "Strict"}
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if luxxle_categ not in ("search", "images", "videos", "news"):
|
||||||
|
raise ValueError("invalid luxxle category: %s" % luxxle_categ)
|
||||||
|
|
||||||
|
|
||||||
|
def _obtain_telemetry_data(query: str) -> dict[str, str]:
|
||||||
|
"""This data is required for sending search queries.
|
||||||
|
|
||||||
|
The luxsearch page (for general results) has a JS dict called ``telemetryData``
|
||||||
|
that contains all the important info, but the others don't, so we don't use it
|
||||||
|
here. But it's useful to understand which info is needed.
|
||||||
|
|
||||||
|
.. code-block:: javascript
|
||||||
|
|
||||||
|
var telemetryData = {
|
||||||
|
errorInformation: errorInformation,
|
||||||
|
query: "youapps club",
|
||||||
|
ip: "10.10.10.10",
|
||||||
|
timeOf: "1781119224",
|
||||||
|
authorization: "db889e0ae67d3c320858ad97f51cc4f0a4d8e1913c4f5ebe5d2eafef606521dd",
|
||||||
|
};
|
||||||
|
|
||||||
|
This data is only valid for very short times
|
||||||
|
"""
|
||||||
|
resp = get(
|
||||||
|
f"{base_url}/lux{luxxle_categ}?q={quote_plus(query)}", headers={"User-Agent": gen_useragent(), "Sec-GPC": "1"}
|
||||||
|
)
|
||||||
|
|
||||||
|
def extr_js_variable(name: str) -> str:
|
||||||
|
val = extr(resp.text, f"var {name} = \"", "\";")
|
||||||
|
if not val:
|
||||||
|
val = extr(resp.text, f"var {name} = '", "';")
|
||||||
|
return val
|
||||||
|
|
||||||
|
return {
|
||||||
|
"ip": extr_js_variable("ip"),
|
||||||
|
"timeOf": extr_js_variable("timeOf"),
|
||||||
|
"authorization": extr_js_variable("authorization"),
|
||||||
|
"preferencesCookie": extr_js_variable("preferencesCookie"),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
telemetry_data = _obtain_telemetry_data(query)
|
||||||
|
|
||||||
|
market = params["searxng_locale"]
|
||||||
|
if market == "all":
|
||||||
|
market = "en-US"
|
||||||
|
|
||||||
|
params["url"] = f"{base_url}/load_{luxxle_categ}.php"
|
||||||
|
search_data = {
|
||||||
|
**telemetry_data,
|
||||||
|
"query": query,
|
||||||
|
"market": market,
|
||||||
|
"safeSearch": safe_search_map[params["safesearch"]],
|
||||||
|
"freshness": "",
|
||||||
|
"language": "english", # UI language
|
||||||
|
}
|
||||||
|
if luxxle_categ == "images":
|
||||||
|
# for some reason this is sent as form data
|
||||||
|
params["data"] = {"searchData": dumps(search_data)}
|
||||||
|
else:
|
||||||
|
params["json"] = {"searchData": search_data}
|
||||||
|
params["method"] = "POST"
|
||||||
|
|
||||||
|
|
||||||
|
def _extract_url_from_redirect(url: str):
|
||||||
|
# urls usually look like "/redirect?url=<url>"
|
||||||
|
query_start_idx = url.find("?url=")
|
||||||
|
if query_start_idx < 0:
|
||||||
|
return url
|
||||||
|
|
||||||
|
url_start_idx = query_start_idx + len("?url=")
|
||||||
|
return unquote_plus(url[url_start_idx:])
|
||||||
|
|
||||||
|
|
||||||
|
def _general_results(doc: ElementType, res: EngineResults):
|
||||||
|
for result in eval_xpath_list(doc, "//div[@id='mainResults']/div[contains(@class, 'resultsContainer')]"):
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=_extract_url_from_redirect(
|
||||||
|
extract_text(eval_xpath(result, "./div[contains(@class, 'urlAddressLink')]/a/@href")) or ""
|
||||||
|
),
|
||||||
|
title=extract_text(eval_xpath(result, "./div[contains(@class, 'urlname')]")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, "./div[contains(@class, 'urlSnippet')]")) or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _news_results(doc: ElementType, res: EngineResults):
|
||||||
|
for result in eval_xpath_list(
|
||||||
|
doc, "//div[contains(@class, 'newsResults')]/div[contains(@class, 'mediaResultNewsPage')]"
|
||||||
|
):
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=_extract_url_from_redirect(
|
||||||
|
extract_text(eval_xpath(result, ".//div[contains(@class, 'mediaResultNewsPageTitle')]/a/@href"))
|
||||||
|
or ""
|
||||||
|
),
|
||||||
|
title=extract_text(eval_xpath(result, ".//div[contains(@class, 'mediaResultNewsPageTitle')]/a")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, ".//div[contains(@class, 'mediaResultNewsPageDescription')]"))
|
||||||
|
or "",
|
||||||
|
thumbnail=extract_text(eval_xpath(result, ".//div[contains(@class, 'mediaResultThumbnail')]//img/@src"))
|
||||||
|
or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _video_results(doc: ElementType, res: EngineResults):
|
||||||
|
for result in eval_xpath_list(doc, "//div[@id='mainResults']/div[contains(@class, 'mediaResult')]"):
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=extract_text(eval_xpath(result, "./@data-url")) or "",
|
||||||
|
title=extract_text(eval_xpath(result, ".//div[contains(@class, 'mediaResultTitleVideo')]/a")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, ".//div[contains(@class, 'mediaResultDescription')]")) or "",
|
||||||
|
thumbnail=extract_text(eval_xpath(result, ".//img[contains(@class, 'videoThumbnail')]/@src")) or "",
|
||||||
|
author=extract_text(eval_xpath(result, ".//div[contains(@class, 'videoCreator')]")) or "",
|
||||||
|
length=parse_duration_string(
|
||||||
|
extract_text(eval_xpath(result, ".//span[contains(@class, 'mediaResultDuration')]")) or ""
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _image_results(doc: ElementType, res: EngineResults):
|
||||||
|
for result in eval_xpath_list(doc, "//div[contains(@class, 'imageResultsWrapper')]/div"):
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=_extract_url_from_redirect(
|
||||||
|
extract_text(eval_xpath(result, ".//a[contains(@class, 'imageResultSource')]/@href")) or ""
|
||||||
|
),
|
||||||
|
title=extract_text(eval_xpath(result, ".//a[contains(@class, 'imageResultTitle')]")) or "",
|
||||||
|
source=extract_text(eval_xpath(result, ".//div[contains(@class, 'imageResultSource')]")) or "",
|
||||||
|
thumbnail_src=extract_text(eval_xpath(result, "./@data-thumbnail-src")) or "",
|
||||||
|
img_src=extract_text(eval_xpath(result, "./@data-image-src")) or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
doc = html.fromstring(resp.text)
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
match luxxle_categ:
|
||||||
|
case "search":
|
||||||
|
_general_results(doc, res)
|
||||||
|
case "images":
|
||||||
|
_image_results(doc, res)
|
||||||
|
case "videos":
|
||||||
|
_video_results(doc, res)
|
||||||
|
case "news":
|
||||||
|
_news_results(doc, res)
|
||||||
|
case _:
|
||||||
|
raise ValueError("unsupported category: %s" % luxxle_categ)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -44,7 +44,7 @@ about = {
|
|||||||
|
|
||||||
base_url = "https://api2.marginalia-search.com"
|
base_url = "https://api2.marginalia-search.com"
|
||||||
safesearch = True
|
safesearch = True
|
||||||
categories = ["general"]
|
categories = ["general", "blogs"]
|
||||||
paging = True
|
paging = True
|
||||||
results_per_page = 20
|
results_per_page = 20
|
||||||
api_key = None
|
api_key = None
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ about = {
|
|||||||
"use_official_api": True,
|
"use_official_api": True,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": 'JSON',
|
"results": 'JSON',
|
||||||
"language": "de",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
language = "de"
|
||||||
categories = ['videos']
|
categories = ['videos']
|
||||||
paging = True
|
paging = True
|
||||||
time_range_support = False
|
time_range_support = False
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ about = {
|
|||||||
}
|
}
|
||||||
paging = True # paging is only supported for general search
|
paging = True # paging is only supported for general search
|
||||||
safesearch = True
|
safesearch = True
|
||||||
|
language_support = True
|
||||||
time_range_support = True # time range search is supported for general and news
|
time_range_support = True # time range search is supported for general and news
|
||||||
max_page = 10
|
max_page = 10
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ about = {
|
|||||||
'use_official_api': False,
|
'use_official_api': False,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'results': 'JSON',
|
'results': 'JSON',
|
||||||
'language': 'de',
|
|
||||||
}
|
}
|
||||||
|
language = "de"
|
||||||
|
|
||||||
paging = True
|
paging = True
|
||||||
categories = ["movies"]
|
categories = ["movies"]
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "ko",
|
|
||||||
}
|
}
|
||||||
|
language = "ko"
|
||||||
|
|
||||||
categories = []
|
categories = []
|
||||||
paging = True
|
paging = True
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "ja",
|
|
||||||
}
|
}
|
||||||
|
language = "ja"
|
||||||
|
|
||||||
categories = ["videos"]
|
categories = ["videos"]
|
||||||
paging = True
|
paging = True
|
||||||
|
|||||||
+2
-10
@@ -4,7 +4,6 @@
|
|||||||
.. _Odysee: https://github.com/OdyseeTeam/odysee-frontend
|
.. _Odysee: https://github.com/OdyseeTeam/odysee-frontend
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import time
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
@@ -12,6 +11,7 @@ import babel
|
|||||||
|
|
||||||
from searx.enginelib.traits import EngineTraits
|
from searx.enginelib.traits import EngineTraits
|
||||||
from searx.locales import language_tag
|
from searx.locales import language_tag
|
||||||
|
from searx.utils import format_duration
|
||||||
|
|
||||||
# Engine metadata
|
# Engine metadata
|
||||||
about = {
|
about = {
|
||||||
@@ -26,6 +26,7 @@ about = {
|
|||||||
# Engine configuration
|
# Engine configuration
|
||||||
paging = True
|
paging = True
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
|
language_support = True
|
||||||
results_per_page = 20
|
results_per_page = 20
|
||||||
categories = ["videos"]
|
categories = ["videos"]
|
||||||
|
|
||||||
@@ -61,15 +62,6 @@ def request(query, params):
|
|||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
# Format the video duration
|
|
||||||
def format_duration(duration):
|
|
||||||
seconds = int(duration)
|
|
||||||
length = time.gmtime(seconds)
|
|
||||||
if length.tm_hour:
|
|
||||||
return time.strftime("%H:%M:%S", length)
|
|
||||||
return time.strftime("%M:%S", length)
|
|
||||||
|
|
||||||
|
|
||||||
def response(resp):
|
def response(resp):
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
results = []
|
results = []
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
|
|
||||||
# engine dependent config
|
# engine dependent config
|
||||||
categories = ["videos"]
|
categories = ["videos"]
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ search_string = 'api/?{query}&limit={limit}'
|
|||||||
result_base_url = 'https://openstreetmap.org/{osm_type}/{osm_id}'
|
result_base_url = 'https://openstreetmap.org/{osm_type}/{osm_id}'
|
||||||
|
|
||||||
# list of supported languages
|
# list of supported languages
|
||||||
supported_languages = ['de', 'en', 'fr', 'it']
|
photon_supported_languages = ["de", "en", "fr", "it"]
|
||||||
|
|
||||||
|
|
||||||
# do search-request
|
# do search-request
|
||||||
@@ -37,7 +37,7 @@ def request(query, params):
|
|||||||
|
|
||||||
if params['language'] != 'all':
|
if params['language'] != 'all':
|
||||||
language = params['language'].split('_')[0]
|
language = params['language'].split('_')[0]
|
||||||
if language in supported_languages:
|
if language in photon_supported_languages:
|
||||||
params['url'] = params['url'] + "&lang=" + language
|
params['url'] = params['url'] + "&lang=" + language
|
||||||
|
|
||||||
# using SearXNG User-Agent
|
# using SearXNG User-Agent
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Podchaser (podcasts)"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://www.podchaser.com",
|
||||||
|
"official_api_documentation": "https://www.podchaser.com/api",
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
categories = []
|
||||||
|
paging = True
|
||||||
|
|
||||||
|
base_url = "https://api.podchaser.com"
|
||||||
|
page_size = 25
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
args = {
|
||||||
|
"filters[term]": query,
|
||||||
|
"limit": page_size,
|
||||||
|
"offset": (params["pageno"] - 1) * page_size,
|
||||||
|
"sort_direction": "desc",
|
||||||
|
"sort_order": "SORT_ORDER_RELEVANCE",
|
||||||
|
}
|
||||||
|
params["url"] = f"{base_url}/podcasts?{urlencode(args)}"
|
||||||
|
params["headers"]["Accept"] = "application/prs.podchaser.v2+json"
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response"):
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
json_results: list[dict[str, str]] = resp.json()["entities"] # pyright: ignore[reportAny]
|
||||||
|
|
||||||
|
for result in json_results:
|
||||||
|
metadata = [f"{result['number_of_episodes']} episodes"]
|
||||||
|
if result["categories"]:
|
||||||
|
metadata.append(", ".join(c["text"] for c in result["categories"])) # pyright: ignore[reportArgumentType]
|
||||||
|
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["feed_url"],
|
||||||
|
title=result["title"],
|
||||||
|
content=result["description"],
|
||||||
|
thumbnail=result["image_url"],
|
||||||
|
publishedDate=datetime.strptime(result["created_at"], "%Y-%m-%d %H:%M:%S"),
|
||||||
|
metadata=" | ".join(metadata),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -77,7 +77,7 @@ from searx.utils import gen_useragent, html_to_text, parse_duration_string
|
|||||||
|
|
||||||
about = {
|
about = {
|
||||||
"website": "https://presearch.io",
|
"website": "https://presearch.io",
|
||||||
"wikidiata_id": "Q7240905",
|
"wikidata_id": "Q7240905",
|
||||||
"official_api_documentation": "https://docs.presearch.io/nodes/api",
|
"official_api_documentation": "https://docs.presearch.io/nodes/api",
|
||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
|
|||||||
@@ -0,0 +1,217 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Privacywall_ claims to be a "privacy-friendly" search engine,
|
||||||
|
but according to a `Privacyguides discussion`_ it's sharing private
|
||||||
|
user information with Microsoft and Amazon.
|
||||||
|
|
||||||
|
.. _Privacywall : https://www.privacywall.org
|
||||||
|
.. _`Privacyguides discussion` : https://discuss.privacyguides.net/t/how-is-privacy-wall-search-engine/29486
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode, unquote_plus
|
||||||
|
|
||||||
|
from lxml import html
|
||||||
|
import babel
|
||||||
|
|
||||||
|
from searx.enginelib.traits import EngineTraits
|
||||||
|
from searx.utils import eval_xpath_list, eval_xpath, extract_text, get_embeded_stream_url, extr
|
||||||
|
from searx.locales import region_tag
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from lxml.etree import ElementBase
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://privacywall.org",
|
||||||
|
"wikidata_id": None,
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "HTML",
|
||||||
|
}
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
safesearch = True
|
||||||
|
time_range_support = True
|
||||||
|
|
||||||
|
base_url = "https://www.privacywall.org"
|
||||||
|
privacywall_category = "general"
|
||||||
|
"""Supported categories are ``general``, ``videos`` and ``images``."""
|
||||||
|
|
||||||
|
|
||||||
|
# corresponds to the "k" query param
|
||||||
|
safesearch_map = {0: "off", 1: "on", 2: "on"}
|
||||||
|
|
||||||
|
# page number sent for videos (is independent of the query) - certainly there's
|
||||||
|
# a pattern in this, but for our use case it's enough to just support the first
|
||||||
|
# 10 pages by hardcoding the page "numbers"
|
||||||
|
video_page_map = {
|
||||||
|
2: "CAoQAA",
|
||||||
|
3: "CBQQAA",
|
||||||
|
4: "CB4QAA",
|
||||||
|
5: "CCgQAA",
|
||||||
|
6: "CDIQAA",
|
||||||
|
7: "CDwQAA",
|
||||||
|
8: "CEYQAA",
|
||||||
|
9: "CFAQAA",
|
||||||
|
10: "CFoQAA",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if privacywall_category not in ("general", "images", "videos"):
|
||||||
|
raise ValueError("invalid category: %s" % privacywall_category)
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
if params["pageno"] > 10:
|
||||||
|
params["url"] = None
|
||||||
|
return
|
||||||
|
|
||||||
|
args = {"q": query, "safesearch": safesearch_map[params["safesearch"]]}
|
||||||
|
if params["searxng_locale"] != "all":
|
||||||
|
args["cc"] = traits.get_region(params["searxng_locale"]) or "US"
|
||||||
|
if params["time_range"]:
|
||||||
|
# time range uses the same "day", "week", "month", "year" naming scheme as SearXNG
|
||||||
|
args["time"] = params["time_range"]
|
||||||
|
|
||||||
|
if params["pageno"] > 1:
|
||||||
|
if privacywall_category == "images":
|
||||||
|
args["page"] = str(params["pageno"])
|
||||||
|
elif privacywall_category == "videos":
|
||||||
|
args["page"] = video_page_map[params["pageno"]]
|
||||||
|
else:
|
||||||
|
raise ValueError("general engine does not support pagination")
|
||||||
|
|
||||||
|
if privacywall_category == "general":
|
||||||
|
params["url"] = f"{base_url}/search/secure/?{urlencode(args)}"
|
||||||
|
else:
|
||||||
|
params["url"] = f"{base_url}/{privacywall_category}/?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def _general_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(doc, "//div[@id='pw-results-main']/div[contains(@class, 'result-card')]"):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=extract_text(eval_xpath(result, ".//a[contains(@class, 'result-url-anchor')]/@href")) or "",
|
||||||
|
title=extract_text(eval_xpath(result, ".//div[contains(@class, 'result_title')]")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, ".//div[contains(@class, 'result-description')]")) or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def _extract_thumbnail_url(url: str) -> str:
|
||||||
|
"""
|
||||||
|
Get the URL from strings like "/videos/video.php?id=<urlencoded-urlhere>".
|
||||||
|
"""
|
||||||
|
url_start = url.find("?id=") + len("?id=")
|
||||||
|
thumbnail = unquote_plus(url[url_start:])
|
||||||
|
return thumbnail
|
||||||
|
|
||||||
|
|
||||||
|
def _image_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(doc, "//div[@id='container']/div[contains(@class, 'imgcontainer')]"):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=extract_text(eval_xpath(result, "./a/@href")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, "./a/@alt")) or "",
|
||||||
|
thumbnail_src=_extract_thumbnail_url(extract_text(eval_xpath(result, ".//img/@src")) or ""),
|
||||||
|
source=extract_text(eval_xpath(result, ".//div[contains(@class, 'image-source-badge')]")) or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def _video_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(
|
||||||
|
doc, "//div[contains(@class, 'video-container')]/div[contains(@class, 'video-card')]"
|
||||||
|
):
|
||||||
|
url = extract_text(eval_xpath(result, "./a/@href")) or ""
|
||||||
|
if not url:
|
||||||
|
continue
|
||||||
|
|
||||||
|
thumbnail = None
|
||||||
|
# looks like <div style="background-image:url(/videos/video.php?id=<urlencoded-urlhere>);position:relative">
|
||||||
|
thumbnail_style = extract_text(eval_xpath(result, ".//div[contains(@class, 'video-img')]/@style"))
|
||||||
|
if thumbnail_style:
|
||||||
|
thumbnail = _extract_thumbnail_url(extr(thumbnail_style, ":url(", ")"))
|
||||||
|
|
||||||
|
res.add(
|
||||||
|
res.types.LegacyResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=url,
|
||||||
|
title=extract_text(eval_xpath(result, ".//h2[contains(@class, 'video-card-title')]")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, ".//p")) or "",
|
||||||
|
thumbnail=thumbnail or "",
|
||||||
|
iframe_src=get_embeded_stream_url(url) or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
doc = html.fromstring(resp.text)
|
||||||
|
match privacywall_category:
|
||||||
|
case "general":
|
||||||
|
return _general_results(doc)
|
||||||
|
case "images":
|
||||||
|
return _image_results(doc)
|
||||||
|
case "videos":
|
||||||
|
return _video_results(doc)
|
||||||
|
case _:
|
||||||
|
raise ValueError("invalid category: %s" % privacywall_category)
|
||||||
|
|
||||||
|
|
||||||
|
def fetch_traits(engine_traits: EngineTraits) -> None:
|
||||||
|
"""Fetch regions from Bing-Web."""
|
||||||
|
# pylint: disable=import-outside-toplevel
|
||||||
|
|
||||||
|
from searx.network import get # see https://github.com/searxng/searxng/issues/762
|
||||||
|
from searx.utils import gen_useragent
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"User-Agent": gen_useragent(),
|
||||||
|
}
|
||||||
|
|
||||||
|
resp = get(base_url, headers=headers)
|
||||||
|
if not resp.ok:
|
||||||
|
raise RuntimeError("Response from Privacywall is not OK.")
|
||||||
|
|
||||||
|
dom = html.fromstring(resp.text)
|
||||||
|
|
||||||
|
# <div class="dropdown-option" onclick="changeMenuLanguage("CZ")"></div>
|
||||||
|
for onclick_listener in eval_xpath(
|
||||||
|
dom, "//div[contains(@class, 'lang-menu')]//div[contains(@class, 'dropdown-option')]/@onclick"
|
||||||
|
):
|
||||||
|
# this is either a normal lang-country tag (e.g. cs-cz) or only a country code (e.g. de, at, ...)
|
||||||
|
country_tag = extr(onclick_listener, "(\"", "\")")
|
||||||
|
|
||||||
|
# the locale tag is only a country tag, so we get languages the from the list of official languages
|
||||||
|
# of the country
|
||||||
|
lang_tag: str
|
||||||
|
for lang_tag in babel.languages.get_official_languages(country_tag, de_facto=True): # pyright: ignore
|
||||||
|
try:
|
||||||
|
sxng_tag = region_tag(babel.Locale.parse(f"{lang_tag}_{country_tag.upper()}"))
|
||||||
|
except babel.UnknownLocaleError:
|
||||||
|
# silently ignore unknown languages
|
||||||
|
continue
|
||||||
|
|
||||||
|
conflict = engine_traits.regions.get(sxng_tag)
|
||||||
|
if conflict:
|
||||||
|
if conflict != sxng_tag:
|
||||||
|
print("CONFLICT: babel %s --> %s" % (sxng_tag, conflict))
|
||||||
|
continue
|
||||||
|
|
||||||
|
engine_traits.regions[sxng_tag] = country_tag
|
||||||
@@ -16,8 +16,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
# Engine Configuration
|
# Engine Configuration
|
||||||
categories = []
|
categories = []
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
paging = True
|
paging = True
|
||||||
categories = ["music", "radio"]
|
categories = ["music", "radio"]
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Resulthunter_ is an American search engine with results from Brave.
|
||||||
|
|
||||||
|
.. _Resulthunter : https://resulthunter.com
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
|
from lxml import html
|
||||||
|
|
||||||
|
from searx import locales
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.utils import eval_xpath_list, eval_xpath, extract_text
|
||||||
|
|
||||||
|
# as it uses brave internally, it has the same locales and timerange/safesearch types
|
||||||
|
from searx.engines.brave import safesearch_map, time_range_map, fetch_traits # pylint: disable=unused-import
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from lxml.etree import ElementBase
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
from searx.enginelib.traits import EngineTraits
|
||||||
|
|
||||||
|
traits: EngineTraits
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://resulthunter.com",
|
||||||
|
"wikidata_id": None,
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "HTML",
|
||||||
|
}
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
safesearch = True
|
||||||
|
time_range_support = True
|
||||||
|
|
||||||
|
base_url = "https://resulthunter.com"
|
||||||
|
resulthunter_categ = "web"
|
||||||
|
"""Supported categories are ``web`` and ``images``."""
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if resulthunter_categ not in ("web", "images"):
|
||||||
|
raise ValueError("invalid category: %s" % resulthunter_categ)
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
args = {
|
||||||
|
"q": query,
|
||||||
|
"search_type": resulthunter_categ,
|
||||||
|
"offset": params["pageno"] - 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
# uses Brave's engine traits
|
||||||
|
ui_lang = locales.get_engine_locale(params["searxng_locale"], traits.custom["ui_lang"], "all")
|
||||||
|
if ui_lang and ui_lang != "all":
|
||||||
|
args["search_lang"] = ui_lang.split("-")[0]
|
||||||
|
|
||||||
|
engine_region = traits.get_region(params["searxng_locale"], "all")
|
||||||
|
if engine_region and engine_region != "all":
|
||||||
|
args["country"] = engine_region
|
||||||
|
|
||||||
|
if params["time_range"]:
|
||||||
|
args["freshness"] = time_range_map[params["time_range"]]
|
||||||
|
|
||||||
|
params["cookies"]["safesearch"] = safesearch_map[params["safesearch"]]
|
||||||
|
|
||||||
|
params["url"] = f"{base_url}/search?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def _general_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(
|
||||||
|
doc, "//div[contains(@class, 'organic-results-container')]/div/div[contains(@class, 'group')]"
|
||||||
|
):
|
||||||
|
url = extract_text(eval_xpath(result, ".//a/@href"))
|
||||||
|
if not url:
|
||||||
|
continue
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=url,
|
||||||
|
title=extract_text(eval_xpath(result, ".//a/h3")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, ".//p")) or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def _image_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(
|
||||||
|
doc, "//div[contains(@class, 'organic-results-container')]//a[contains(@class, 'group')]"
|
||||||
|
):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=extract_text(eval_xpath(result, "./@href")) or "",
|
||||||
|
title=extract_text(eval_xpath(result, "./img/@alt")) or "",
|
||||||
|
thumbnail_src=extract_text(eval_xpath(result, "./img/@src")) or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
doc = html.fromstring(resp.text)
|
||||||
|
|
||||||
|
match resulthunter_categ:
|
||||||
|
case "web":
|
||||||
|
return _general_results(doc)
|
||||||
|
case "images":
|
||||||
|
return _image_results(doc)
|
||||||
|
case _:
|
||||||
|
raise ValueError("invalid resulthunter category: %s" % resulthunter_categ)
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Search engines by System1 (general).
|
||||||
|
|
||||||
|
System1 is an advertising company, and provides all its search engines as a
|
||||||
|
subdomain of ``s1search.co``. As a result, it has more than 1000 subdomains, of
|
||||||
|
which some work, and some don't.
|
||||||
|
|
||||||
|
Some of the engines get their results from Google, others get them from Yahoo.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode, urlparse, parse_qs
|
||||||
|
|
||||||
|
from lxml import html
|
||||||
|
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.enginelib import EngineCache
|
||||||
|
from searx.utils import eval_xpath_list, eval_xpath, extract_text
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://s1search.co",
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "HTML",
|
||||||
|
}
|
||||||
|
|
||||||
|
base_url = "" # alternatively: search.gmx.net
|
||||||
|
categories = ["general"]
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
|
||||||
|
CACHE: EngineCache
|
||||||
|
"""Cache to store verification tokens for pagination."""
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if not base_url:
|
||||||
|
raise ValueError("base_url must be set")
|
||||||
|
|
||||||
|
|
||||||
|
def setup(engine_settings: dict[str, t.Any]) -> bool:
|
||||||
|
global CACHE # pylint: disable=global-statement
|
||||||
|
CACHE = EngineCache(engine_settings["name"])
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def _cache_key(query: str, pageno: int) -> str:
|
||||||
|
return f"{query}|{pageno}"
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams"):
|
||||||
|
args = {"q": query, "page": params["pageno"]}
|
||||||
|
if params["pageno"] > 1:
|
||||||
|
sc = CACHE.get(_cache_key(query, params["pageno"]))
|
||||||
|
# sc is required for pagination to avoid rate-limits
|
||||||
|
if not sc:
|
||||||
|
params["url"] = None
|
||||||
|
return
|
||||||
|
|
||||||
|
args["sc"] = sc
|
||||||
|
|
||||||
|
params["url"] = f"{base_url}/serp?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
doc = html.fromstring(resp.text)
|
||||||
|
|
||||||
|
for suggestion in eval_xpath_list(doc, "//div[@class='aylf-yahoo-bottom' or @class='aylf-yahoo-sidebar']/div"):
|
||||||
|
res.add(res.types.LegacyResult({"suggestion": extract_text(suggestion)}))
|
||||||
|
|
||||||
|
for result in eval_xpath_list(
|
||||||
|
doc, "//div[contains(@class, 'web-yahoo') or contains(@class, 'web-google')]/div[contains(@class, '__result')]"
|
||||||
|
):
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=extract_text(eval_xpath(result, ".//a[contains(@class, 'title')]/@href")),
|
||||||
|
title=extract_text(eval_xpath(result, ".//a[contains(@class, 'title')]")),
|
||||||
|
content=extract_text(eval_xpath(result, ".//span[contains(@class, 'description') or @class='']")),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# store pagination keys to be able to access next pages
|
||||||
|
for page_href in eval_xpath_list(doc, "//a[contains(@class, 'pagination__num')]"):
|
||||||
|
# target_url looks like "/serp?q=test&page=2&sc=RVlBPMDPVhWR20"
|
||||||
|
target_url = extract_text(eval_xpath(page_href, "./@href"))
|
||||||
|
target_url = parse_qs(urlparse(target_url).query)
|
||||||
|
pageno = int(target_url["page"][0])
|
||||||
|
sc = target_url["sc"][0]
|
||||||
|
CACHE.set(_cache_key(resp.search_params["query"], pageno), sc)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -13,8 +13,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": 'JSON',
|
"results": 'JSON',
|
||||||
'language': 'fr',
|
|
||||||
}
|
}
|
||||||
|
language = "fr"
|
||||||
|
|
||||||
categories = ['movies']
|
categories = ['movies']
|
||||||
paging = True
|
paging = True
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": 'JSON',
|
"results": 'JSON',
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
|
|
||||||
# engine dependent config
|
# engine dependent config
|
||||||
categories = ['videos']
|
categories = ['videos']
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "cz",
|
|
||||||
}
|
}
|
||||||
|
language = "cz"
|
||||||
|
|
||||||
categories = ['general', 'web']
|
categories = ['general', 'web']
|
||||||
base_url = 'https://search.seznam.cz/'
|
base_url = 'https://search.seznam.cz/'
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
# Engine Configuration
|
# Engine Configuration
|
||||||
categories = ["general"]
|
categories = ["general"]
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
categories = ["videos"]
|
categories = ["videos"]
|
||||||
paging = True
|
paging = True
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ about = {
|
|||||||
"use_official_api": False,
|
"use_official_api": False,
|
||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "HTML",
|
"results": "HTML",
|
||||||
"language": "zh",
|
|
||||||
}
|
}
|
||||||
|
language = "zh"
|
||||||
|
|
||||||
# Engine Configuration
|
# Engine Configuration
|
||||||
categories = ["news"]
|
categories = ["news"]
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ max_page = 18
|
|||||||
"""Tested 18 pages maximum (argument ``page``), to be save max is set to 20."""
|
"""Tested 18 pages maximum (argument ``page``), to be save max is set to 20."""
|
||||||
|
|
||||||
time_range_support = True
|
time_range_support = True
|
||||||
|
language_support = True
|
||||||
safesearch = True
|
safesearch = True
|
||||||
|
|
||||||
time_range_dict = {"day": "d", "week": "w", "month": "m", "year": "y"}
|
time_range_dict = {"day": "d", "week": "w", "month": "m", "year": "y"}
|
||||||
@@ -382,6 +383,9 @@ def _get_image_result(result) -> dict[str, t.Any] | None:
|
|||||||
size_str = "".join(filter(str.isdigit, result["filesize"]))
|
size_str = "".join(filter(str.isdigit, result["filesize"]))
|
||||||
filesize = humanize_bytes(int(size_str))
|
filesize = humanize_bytes(int(size_str))
|
||||||
|
|
||||||
|
img_format = result.get("format").upper()
|
||||||
|
if img_format == "UNKNOWN":
|
||||||
|
img_format = ""
|
||||||
return {
|
return {
|
||||||
"template": "images.html",
|
"template": "images.html",
|
||||||
"url": url,
|
"url": url,
|
||||||
@@ -390,7 +394,7 @@ def _get_image_result(result) -> dict[str, t.Any] | None:
|
|||||||
"img_src": result.get("rawImageUrl"),
|
"img_src": result.get("rawImageUrl"),
|
||||||
"thumbnail_src": thumbnailUrl,
|
"thumbnail_src": thumbnailUrl,
|
||||||
"resolution": resolution,
|
"resolution": resolution,
|
||||||
"img_format": result.get("format"),
|
"img_format": img_format,
|
||||||
"filesize": filesize,
|
"filesize": filesize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Startpagina is a Netherlands search engine by `Kompas`_. It takes all its
|
||||||
|
results from Google.
|
||||||
|
|
||||||
|
.. _Kompas: https://www.kompaspublishing.nl/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
|
from dateutil import parser
|
||||||
|
|
||||||
|
from searx.utils import format_duration
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://startpagina.nl",
|
||||||
|
"wikidata_id": None,
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
|
||||||
|
language = "ne"
|
||||||
|
paging = True
|
||||||
|
safesearch = True
|
||||||
|
|
||||||
|
categories = ["general"]
|
||||||
|
startpagina_categ = "web"
|
||||||
|
"""Category to search in. Can be either "web", "images", "videos" or "news"."""
|
||||||
|
page_size = 10
|
||||||
|
|
||||||
|
|
||||||
|
api_url = "https://search.kompas.services"
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if startpagina_categ not in ("web", "images", "videos", "news"):
|
||||||
|
raise ValueError("invalid search type: %s" % startpagina_categ)
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
args = {"q": query, "page_size": page_size, "page": params["pageno"]}
|
||||||
|
params["url"] = f"{api_url}/api/v2/search/{startpagina_categ}/?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response"):
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
json_resp = resp.json()
|
||||||
|
|
||||||
|
for result in json_resp["results"]:
|
||||||
|
if startpagina_categ == "web":
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["original_url"],
|
||||||
|
title=result["title"],
|
||||||
|
content=result["description"],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif startpagina_categ == "news":
|
||||||
|
publishedDate = None
|
||||||
|
try:
|
||||||
|
publishedDate = parser.parse(result["date"])
|
||||||
|
except parser.ParserError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["original_url"],
|
||||||
|
title=result["title"],
|
||||||
|
content=result["description"],
|
||||||
|
thumbnail=result["image"]["thumbnail_url"],
|
||||||
|
publishedDate=publishedDate,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif startpagina_categ == "videos":
|
||||||
|
res.add(
|
||||||
|
res.types.LegacyResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=result["original_url"],
|
||||||
|
title=result["title"],
|
||||||
|
content=result["description"],
|
||||||
|
thumbnail=result["video"]["thumbnail_url"],
|
||||||
|
length=format_duration(result["video"]["duration"]),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif startpagina_categ == "images":
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=result["original_url"],
|
||||||
|
title=result["title"],
|
||||||
|
content=result["description"],
|
||||||
|
thumbnail_src=result["image"]["thumbnail_url"],
|
||||||
|
resolution=f"{result['image']['width']}x{result['image']['height']}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
for related in json_resp["related_searches"]:
|
||||||
|
res.add(res.types.LegacyResult(suggestion=related["query"]))
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -27,8 +27,9 @@ about = {
|
|||||||
'use_official_api': True,
|
'use_official_api': True,
|
||||||
'require_api_key': False,
|
'require_api_key': False,
|
||||||
'results': 'JSON',
|
'results': 'JSON',
|
||||||
'language': 'de',
|
|
||||||
}
|
}
|
||||||
|
language = "de"
|
||||||
|
|
||||||
categories = ['general', 'news']
|
categories = ['general', 'news']
|
||||||
paging = True
|
paging = True
|
||||||
|
|
||||||
|
|||||||
@@ -134,9 +134,12 @@ def response(resp: "SXNG_Response") -> EngineResults:
|
|||||||
|
|
||||||
if tiger_category == "Websuche":
|
if tiger_category == "Websuche":
|
||||||
for result in eval_xpath_list(doc, "//div[@id='mainContainer']//table/tr"):
|
for result in eval_xpath_list(doc, "//div[@id='mainContainer']//table/tr"):
|
||||||
|
url = extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]/@href"))
|
||||||
|
if not url:
|
||||||
|
continue
|
||||||
res.add(
|
res.add(
|
||||||
res.types.MainResult(
|
res.types.MainResult(
|
||||||
url=extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]/@href")),
|
url=url,
|
||||||
title=extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]")) or "",
|
title=extract_text(eval_xpath(result, ".//a[contains(@class, 'weblink')]")) or "",
|
||||||
content=extract_text(eval_xpath(result, ".//*[contains(@class, 'webbodynopic')]")) or "",
|
content=extract_text(eval_xpath(result, ".//*[contains(@class, 'webbodynopic')]")) or "",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""T-Online_ is a German news portal, which is powered by Ströer, a German
|
||||||
|
advertising company, not by Deutsche Telekom (contrary to its name).
|
||||||
|
|
||||||
|
It gets its web results from Google, image results from Flickr and videos
|
||||||
|
results from YouTube.
|
||||||
|
|
||||||
|
.. _T-Online: https://www.t-online.de/
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
|
from lxml import html
|
||||||
|
|
||||||
|
from searx.utils import eval_xpath_list, eval_xpath, extract_text, get_embeded_stream_url, ElementType
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.enginelib import EngineAbout
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = EngineAbout(
|
||||||
|
website="https://www.t-online.de",
|
||||||
|
wikidata_id="Q590940",
|
||||||
|
results="HTML",
|
||||||
|
)
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
time_range_support = True
|
||||||
|
|
||||||
|
base_url = "https://suche.t-online.de"
|
||||||
|
tonline_categ = "web"
|
||||||
|
"""Supported categories are ``web``, ``videos``, ``news`` and ``images``."""
|
||||||
|
|
||||||
|
time_range_map = {"day": "d", "week": "w", "month": "m", "year": "y"}
|
||||||
|
|
||||||
|
# result provider has to be specified during pagination, pagination can alternatively
|
||||||
|
# use "tonline" to only search for results from t-online news articles
|
||||||
|
tonline_channel_map = {"images": "flickr", "videos": "yt"}
|
||||||
|
|
||||||
|
language = "de"
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if tonline_categ not in ("web", "images", "videos", "news"):
|
||||||
|
raise ValueError("invalid category: %s" % tonline_categ)
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
# "mandant", "dia" and "ptl" are not needed, but this might reduce changes of captchas
|
||||||
|
args = {"q": query, "mandant": "toi", "dia": "suche", "ptl": "std"}
|
||||||
|
if params["time_range"]:
|
||||||
|
args["age"] = time_range_map[params["time_range"]]
|
||||||
|
|
||||||
|
if params["pageno"] > 1 and tonline_categ in tonline_channel_map:
|
||||||
|
ch = tonline_channel_map[tonline_categ]
|
||||||
|
args["ch"] = ch
|
||||||
|
args[f"{ch}_page"] = str(params["pageno"])
|
||||||
|
else:
|
||||||
|
args["page"] = str(params["pageno"])
|
||||||
|
|
||||||
|
params["url"] = f"{base_url}/{tonline_categ}?{urlencode(args)}"
|
||||||
|
|
||||||
|
|
||||||
|
def _general_results(doc: ElementType, res: EngineResults):
|
||||||
|
result: ElementType
|
||||||
|
for result in eval_xpath_list(doc, "//div[@id='google_re']/div[contains(@class, 'doc')]"):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=extract_text(eval_xpath(result, "./a/@href") or ""),
|
||||||
|
title=extract_text(eval_xpath(result, ".//span[contains(@class, 'tMMReshl')]") or "") or "",
|
||||||
|
content=extract_text(eval_xpath(result, ".//div[contains(@class, 'tMMRest')]") or "") or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
suggestion: ElementType
|
||||||
|
for suggestion in eval_xpath_list(doc, "//div[starts-with(@class, 'rsbl')]/a"):
|
||||||
|
res.add(res.types.LegacyResult({"suggestion": extract_text(suggestion)}))
|
||||||
|
|
||||||
|
|
||||||
|
def _image_results(doc: ElementType, res: EngineResults):
|
||||||
|
result: ElementType
|
||||||
|
for result in eval_xpath_list(doc, "//div[@class='doc']"):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=extract_text(eval_xpath(result, "./a/@href") or ""),
|
||||||
|
title=extract_text(eval_xpath(result, ".//div[contains(@class, 'doc_info')]") or "") or "",
|
||||||
|
thumbnail_src=extract_text(eval_xpath(result, ".//img/@src") or "") or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _news_results(doc: ElementType, res: EngineResults):
|
||||||
|
result: ElementType
|
||||||
|
title_parts: list[ElementType]
|
||||||
|
for result in eval_xpath_list(doc, "//div[@id='portal_re']/div[contains(@class, 'doc')]"):
|
||||||
|
title_parts = eval_xpath(result, ".//a[starts-with(@class, 'tMMReshl')]")
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=extract_text(eval_xpath(result, "(./a/@href)[1]") or ""),
|
||||||
|
title=" - ".join(extract_text(part) or "" for part in title_parts),
|
||||||
|
content=extract_text(eval_xpath(result, ".//div[contains(@class, 'tMMRest')]") or "") or "",
|
||||||
|
thumbnail=extract_text(eval_xpath(result, ".//img[contains(@class, 'desk')]/@src") or "") or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _video_results(doc: ElementType, res: EngineResults):
|
||||||
|
result: ElementType
|
||||||
|
for result in eval_xpath_list(doc, "//div[@class='doc']"):
|
||||||
|
url: str | None = extract_text(eval_xpath(result, "./a/@href") or "")
|
||||||
|
if url is None:
|
||||||
|
continue
|
||||||
|
title_parts: list[ElementType] = eval_xpath(result, ".//a[starts-with(@class, 'tMMReshl')]")
|
||||||
|
res.add(
|
||||||
|
res.types.LegacyResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=url,
|
||||||
|
title=" - ".join(extract_text(part) or "" for part in title_parts),
|
||||||
|
thumbnail=extract_text(eval_xpath(result, ".//img/@src") or "") or "",
|
||||||
|
iframe_src=get_embeded_stream_url(url) or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
doc = html.fromstring(resp.text)
|
||||||
|
res = EngineResults()
|
||||||
|
match tonline_categ:
|
||||||
|
case "web":
|
||||||
|
_general_results(doc, res)
|
||||||
|
case "news":
|
||||||
|
_news_results(doc, res)
|
||||||
|
case "images":
|
||||||
|
_image_results(doc, res)
|
||||||
|
case "videos":
|
||||||
|
_video_results(doc, res)
|
||||||
|
case _:
|
||||||
|
raise ValueError("invalid category: %s" % tonline_categ)
|
||||||
|
return res
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Tusksearch_ is an American search engine that claims to fight censorship.
|
||||||
|
Its search results are (at least partially) from Brave.
|
||||||
|
|
||||||
|
.. _Tusksearch: https://tusksearch.com/about
|
||||||
|
"""
|
||||||
|
|
||||||
|
from json import loads
|
||||||
|
import random
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
from dateutil import parser
|
||||||
|
|
||||||
|
from searx.exceptions import SearxEngineAPIException
|
||||||
|
from searx.network import get
|
||||||
|
from searx.utils import html_to_text
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://tusksearch.com",
|
||||||
|
"wikidata_id": None,
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "JSON",
|
||||||
|
}
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
|
||||||
|
categories = ["general"]
|
||||||
|
tusk_categ = "web"
|
||||||
|
"""Category to search in. Can be either "web", "images", "videos" or "news"."""
|
||||||
|
|
||||||
|
|
||||||
|
api_url = "https://api.tusksearch.com"
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if tusk_categ not in ("web", "images", "videos", "news"):
|
||||||
|
raise ValueError("invalid search type: %s" % tusk_categ)
|
||||||
|
|
||||||
|
|
||||||
|
def _obtain_x_sid() -> tuple[str, str]:
|
||||||
|
"""
|
||||||
|
The session ID ("sid") is encoded as a byte array in ``embed.js``.
|
||||||
|
It is only valid for exactly one request, so we can't cache it.
|
||||||
|
|
||||||
|
The header key is usually called `x-sid-{UUIDv4}`, and the value is
|
||||||
|
usually a plain UUIDv4 (but a different one than in the header key).
|
||||||
|
"""
|
||||||
|
resp = get(f"{api_url}/revcontent/embed.js")
|
||||||
|
if not resp.ok:
|
||||||
|
raise SearxEngineAPIException("failed to obtain request x-sid token")
|
||||||
|
|
||||||
|
# data is prefixed by 'var x='
|
||||||
|
data_array = loads(resp.text[6:])
|
||||||
|
|
||||||
|
def _byte_array_to_ascii(text: list[int]) -> str:
|
||||||
|
"""
|
||||||
|
Converts a byte array (e.g. [81, 101, 97, 114, 88, 78, 71]) to the ASCII
|
||||||
|
string representation (e.g. "SearXNG").
|
||||||
|
"""
|
||||||
|
return "".join([chr(x) for x in text])
|
||||||
|
|
||||||
|
x_sid_header = _byte_array_to_ascii(data_array[3])
|
||||||
|
x_sid_value = _byte_array_to_ascii(data_array[4])
|
||||||
|
return x_sid_header, x_sid_value
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
# images don't support pagination, news and videos only support two pages
|
||||||
|
if tusk_categ == "images" and params["pageno"] > 1 or tusk_categ in ("news", "videos") and params["pageno"] > 2:
|
||||||
|
params["url"] = None
|
||||||
|
return
|
||||||
|
|
||||||
|
args = {
|
||||||
|
"q": query,
|
||||||
|
"p": params["pageno"],
|
||||||
|
"l": "center", # political direction: "left", "center" or "right"
|
||||||
|
}
|
||||||
|
if tusk_categ == "images":
|
||||||
|
params["url"] = f"{api_url}/Search/Image?{urlencode(args)}"
|
||||||
|
else:
|
||||||
|
# web response also contains news and videos
|
||||||
|
params["url"] = f"{api_url}/Search/Web?{urlencode(args)}"
|
||||||
|
|
||||||
|
x_sid_header, x_sid_value = _obtain_x_sid()
|
||||||
|
params["headers"] = {
|
||||||
|
x_sid_header: x_sid_value,
|
||||||
|
# required - we send a random longitude and latitude instead of the actual user location
|
||||||
|
'x-lon': str(random.random() * 90),
|
||||||
|
'x-lat': str(random.random() * 90),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response"):
|
||||||
|
res = EngineResults()
|
||||||
|
|
||||||
|
json_resp = resp.json()["results"]
|
||||||
|
|
||||||
|
if tusk_categ == "web":
|
||||||
|
for result in (json_resp.get("web") or {}).get("results", []):
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["url"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
content=html_to_text(result["description"]),
|
||||||
|
thumbnail=(result["thumbnail"] or {}).get("src") or "",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif tusk_categ == "news":
|
||||||
|
for result in (json_resp.get("news") or {}).get("results", []):
|
||||||
|
publishedDate = None
|
||||||
|
try:
|
||||||
|
publishedDate = parser.parse(result["age"])
|
||||||
|
except parser.ParserError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=result["url"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
content=html_to_text(result["description"]),
|
||||||
|
thumbnail=result["thumbnail"]["src"],
|
||||||
|
publishedDate=publishedDate,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif tusk_categ == "videos":
|
||||||
|
for result in (json_resp.get("videos") or {}).get("results", []):
|
||||||
|
publishedDate = None
|
||||||
|
try:
|
||||||
|
publishedDate = parser.parse(result["age"])
|
||||||
|
except parser.ParserError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
res.add(
|
||||||
|
res.types.LegacyResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=result["url"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
content=html_to_text(result["description"]),
|
||||||
|
thumbnail=result["thumbnail"]["src"],
|
||||||
|
publishedDate=publishedDate,
|
||||||
|
length=result["video"].get("duration"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif tusk_categ == "images":
|
||||||
|
for result in json_resp:
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=result["url"],
|
||||||
|
title=html_to_text(result["title"]),
|
||||||
|
img_src=result["properties"]["url"],
|
||||||
|
thumbnail_src=result["thumbnail"]["src"],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return res
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""Vuhuv_ is a Turkish search engine, that also provides English results.
|
||||||
|
|
||||||
|
.. _Vuhuv : https://vuhuv.com
|
||||||
|
"""
|
||||||
|
|
||||||
|
import typing as t
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
|
from lxml import html
|
||||||
|
|
||||||
|
from searx.result_types import EngineResults
|
||||||
|
from searx.utils import eval_xpath_list, eval_xpath, extract_text
|
||||||
|
|
||||||
|
|
||||||
|
if t.TYPE_CHECKING:
|
||||||
|
from lxml.etree import ElementBase
|
||||||
|
from searx.extended_types import SXNG_Response
|
||||||
|
from searx.search.processors import OnlineParams
|
||||||
|
|
||||||
|
about = {
|
||||||
|
"website": "https://vuhuv.com",
|
||||||
|
"wikidata_id": None,
|
||||||
|
"official_api_documentation": None,
|
||||||
|
"use_official_api": False,
|
||||||
|
"require_api_key": False,
|
||||||
|
"results": "HTML",
|
||||||
|
}
|
||||||
|
|
||||||
|
paging = True
|
||||||
|
|
||||||
|
base_url = "https://vuhuv.com"
|
||||||
|
vuhuv_category = "general"
|
||||||
|
"""Supported categories are ``general``, ``videos`` and ``images``."""
|
||||||
|
|
||||||
|
|
||||||
|
# corresponds to the "k" query param
|
||||||
|
category_map = {"general": 1, "images": 2, "videos": 3}
|
||||||
|
|
||||||
|
|
||||||
|
def init(_):
|
||||||
|
if vuhuv_category not in category_map:
|
||||||
|
raise ValueError("invalid category: %s" % vuhuv_category)
|
||||||
|
|
||||||
|
|
||||||
|
def request(query: str, params: "OnlineParams") -> None:
|
||||||
|
# the purpose of "d" and "dh" are unknown, but the website
|
||||||
|
# sends them, and without them the results are different
|
||||||
|
args = {"k": category_map[vuhuv_category], "p": params["pageno"], "q": query, "d": 1, "dh": 1}
|
||||||
|
params["url"] = f"{base_url}/veri2/?{urlencode(args)}"
|
||||||
|
params["headers"]["Referer"] = f"{base_url}/"
|
||||||
|
|
||||||
|
|
||||||
|
def _general_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(doc, "//div[contains(@class, 'sonuc')]/div"):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
url=extract_text(eval_xpath(result, "./a/@href")) or "",
|
||||||
|
title=extract_text(eval_xpath(result, "./a/span")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, "./ins")) or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def _image_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(doc, "//div[contains(@class, 'item gorsel')]"):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.Image(
|
||||||
|
url=extract_text(eval_xpath(result, "./a/@href")) or "",
|
||||||
|
title=extract_text(eval_xpath(result, "./a/@title")) or "",
|
||||||
|
resolution=extract_text(eval_xpath(result, "div[contains(@class, 'olculeri')]")) or "",
|
||||||
|
thumbnail_src="https:" + str(extract_text(eval_xpath(result, "./@data-kgorsel"))),
|
||||||
|
img_src=extract_text(eval_xpath(result, "./@data-resimurl")) or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def _video_results(doc: "ElementBase") -> EngineResults:
|
||||||
|
res = EngineResults()
|
||||||
|
for result in eval_xpath_list(doc, "//div[contains(@class, 'item video')]"):
|
||||||
|
(
|
||||||
|
res.add(
|
||||||
|
res.types.MainResult(
|
||||||
|
template="videos.html",
|
||||||
|
url=extract_text(eval_xpath(result, "./a/@href")) or "",
|
||||||
|
title=extract_text(eval_xpath(result, "./a/@title")) or "",
|
||||||
|
content=extract_text(eval_xpath(result, ".//div[contains(@class, 'abaslik')]")) or "",
|
||||||
|
thumbnail=extract_text(eval_xpath(result, "./@data-kgorsel")) or "",
|
||||||
|
iframe_src=extract_text(eval_xpath(result, "./@data-embedurl")) or "",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp: "SXNG_Response") -> EngineResults:
|
||||||
|
doc = html.fromstring(resp.text)
|
||||||
|
match vuhuv_category:
|
||||||
|
case "general":
|
||||||
|
return _general_results(doc)
|
||||||
|
case "images":
|
||||||
|
return _image_results(doc)
|
||||||
|
case "videos":
|
||||||
|
return _video_results(doc)
|
||||||
|
case _:
|
||||||
|
raise ValueError("invalid vuhuv category: %s" % vuhuv_category)
|
||||||
@@ -40,6 +40,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": 'JSON',
|
"results": 'JSON',
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
|
|
||||||
display_type = ["infobox"]
|
display_type = ["infobox"]
|
||||||
"""A list of display types composed from ``infobox`` and ``list``. The latter
|
"""A list of display types composed from ``infobox`` and ``list``. The latter
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
|
|
||||||
display_type = ["infobox"]
|
display_type = ["infobox"]
|
||||||
"""A list of display types composed from ``infobox`` and ``list``. The latter
|
"""A list of display types composed from ``infobox`` and ``list``. The latter
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ from lxml import html
|
|||||||
from searx.utils import extract_text, extract_url, eval_xpath, eval_xpath_list
|
from searx.utils import extract_text, extract_url, eval_xpath, eval_xpath_list
|
||||||
from searx.network import raise_for_httperror
|
from searx.network import raise_for_httperror
|
||||||
from searx.result_types import EngineResults
|
from searx.result_types import EngineResults
|
||||||
|
from searx.enginelib import EngineAbout
|
||||||
|
|
||||||
|
about = EngineAbout()
|
||||||
|
|
||||||
search_url = None
|
search_url = None
|
||||||
"""
|
"""
|
||||||
@@ -289,7 +292,7 @@ def response(resp) -> EngineResults: # pylint: disable=too-many-branches
|
|||||||
|
|
||||||
if results_xpath:
|
if results_xpath:
|
||||||
for result in eval_xpath_list(dom, results_xpath):
|
for result in eval_xpath_list(dom, results_xpath):
|
||||||
url = extract_url(eval_xpath_list(result, url_xpath, min_len=1), search_url)
|
url = extract_url(eval_xpath(result, url_xpath), search_url)
|
||||||
title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))
|
title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))
|
||||||
content = extract_text(eval_xpath_list(result, content_xpath))
|
content = extract_text(eval_xpath_list(result, content_xpath))
|
||||||
tmp_result = {'url': url, 'title': title, 'content': content}
|
tmp_result = {'url': url, 'title': title, 'content': content}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ about = {
|
|||||||
"require_api_key": False,
|
"require_api_key": False,
|
||||||
"results": "JSON",
|
"results": "JSON",
|
||||||
}
|
}
|
||||||
|
language_support = True
|
||||||
|
|
||||||
base_url = "https://api.yep.com"
|
base_url = "https://api.yep.com"
|
||||||
web_base_url = "https://yep.com"
|
web_base_url = "https://yep.com"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user