OpenWebUI integration
This commit is contained in:
@@ -5,7 +5,7 @@ from bs4 import BeautifulSoup
|
||||
import requests
|
||||
|
||||
MEILI_URL = os.getenv("MEILI_URL","http://localhost:7700")
|
||||
MEILI_KEY = os.getenv("MEILI_KEY","devkey")
|
||||
MEILI_KEY = os.getenv("MEILI_KEY","change_me")
|
||||
|
||||
def post(doc):
|
||||
r = requests.post(f"{MEILI_URL}/indexes/library/documents",
|
||||
@@ -26,7 +26,7 @@ for path in sys.argv[1:]:
|
||||
doc = {
|
||||
"id": hashlib.sha1((path+item.get_name()).encode()).hexdigest(),
|
||||
"type": "epub",
|
||||
"title": f"{title} — {item.get_name()}",
|
||||
"title": f"{title} - {item.get_name()}",
|
||||
"source": f"file://{os.path.abspath(path)}",
|
||||
"date": "",
|
||||
"text": text,
|
||||
|
@@ -2,7 +2,7 @@
|
||||
set -euo pipefail
|
||||
ZIM="$1"
|
||||
BASE_URL=${MEILI_URL:-http://localhost:7700}
|
||||
KEY=${MEILI_KEY:-devkey}
|
||||
KEY=${MEILI_KEY:-change_me}
|
||||
|
||||
zimdump list "$ZIM" --json | jq -rc '.[] | select(.mimetype=="text/html") | .path' | while read -r path; do
|
||||
html="$(zimdump dump "$ZIM" "$path" 2>/dev/null || true)"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
BASE_URL=${MEILI_URL:-http://localhost:7700}
|
||||
KEY=${MEILI_KEY:-devkey}
|
||||
KEY=${MEILI_KEY:-change_me}
|
||||
|
||||
for pdf in "$@"; do
|
||||
title="$(basename "$pdf")"
|
||||
|
Reference in New Issue
Block a user