feat: add SearX search plugin and alert backend

Add standalone !searx command for on-demand SearXNG search (top 3 results).
Add SearX as a third backend (sx) to the alert plugin for keyword monitoring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-15 15:28:00 +01:00
parent 4c9dffaaf2
commit 10f62631be
6 changed files with 516 additions and 31 deletions

View File

@@ -341,12 +341,20 @@ No API credentials needed (uses public GQL endpoint).
!alert check <name> # Force-poll now
```
Searches keywords across YouTube (InnerTube) and Twitch (GQL) simultaneously.
Searches keywords across YouTube (InnerTube), Twitch (GQL), and SearXNG simultaneously.
Names: lowercase alphanumeric + hyphens, 1-20 chars. Keywords: 1-100 chars.
Max 20 alerts/channel. Polls every 5min. Max 5 announcements per platform per cycle.
Format: `[name/yt] Title -- URL` or `[name/tw] Title -- URL`.
Format: `[name/yt] Title -- URL`, `[name/tw] Title -- URL`, or `[name/sx] Title -- URL`.
No API credentials needed. Persists across restarts.
## SearX
```
!searx <query> # Search SearXNG
```
Shows top 3 results as `Title -- URL`. Channel only. Max query length: 200 chars.
## Plugin Template
```python

View File

@@ -122,6 +122,7 @@ format = "text" # Log format: "text" (default) or "json"
| `!username <user>` | Check username across ~25 services |
| `!username <user> <service>` | Check single service |
| `!username list` | Show available services by category |
| `!searx <query>` | Search SearXNG and show top results |
### Command Shorthand
@@ -630,11 +631,34 @@ Polling and announcements:
- `list` shows live/error status indicators next to each streamer
- `check` forces an immediate poll and reports current status
### `!searx` -- SearXNG Web Search
Search the local SearXNG instance and display top results.
```
!searx <query...> Search SearXNG and show top results
```
- Open to all users, channel only (no PM)
- Query is everything after `!searx`
- Shows top 3 results as `Title -- URL`
- Titles truncated to 80 characters
- Query limited to 200 characters
Output format:
```
Title One -- https://example.com/page1
Title Two -- https://example.com/page2
Title Three -- https://example.com/page3
```
### `!alert` -- Keyword Alert Subscriptions
Search keywords across multiple platforms (YouTube, Twitch) and announce new
results. Unlike `!rss`/`!yt`/`!twitch` which follow specific channels/feeds,
`!alert` searches keywords across all supported platforms simultaneously.
Search keywords across multiple platforms (YouTube, Twitch, SearXNG) and
announce new results. Unlike `!rss`/`!yt`/`!twitch` which follow specific
channels/feeds, `!alert` searches keywords across all supported platforms
simultaneously.
```
!alert add <name> <keyword...> Add keyword alert (admin)
@@ -654,12 +678,14 @@ Platforms searched:
- **YouTube** -- InnerTube search API (no auth required)
- **Twitch** -- Public GQL endpoint: live streams and VODs (no auth required)
- **SearXNG** -- Local SearXNG instance (no auth required)
Polling and announcements:
- Alerts are polled every 5 minutes by default
- On `add`, existing results are recorded without announcing (prevents flood)
- New results announced as `[name/yt] Title -- URL` or `[name/tw] Title -- URL`
- New results announced as `[name/yt] Title -- URL`, `[name/tw] Title -- URL`,
or `[name/sx] Title -- URL`
- Maximum 5 items announced per platform per poll; excess shown as `... and N more`
- Titles are truncated to 80 characters
- Each platform maintains its own seen list (capped at 200 per platform)