Lidarr и beets: управление музыкой, теги, дубли
Lidarr 3.1.0 в CT 111 (192.168.1.240:8686): корневая папка /music, qBittorrent с категорией lidarr, синхронизация индексаторов из Prowlarr. Образ через ghcr.nju.edu.cn (lscr.io тянется слишком медленно), host-сеть (-p не пробрасывал порт). music_tools.py: --status, --import (beets), --enrich (MusicBrainz), --dupes (fpcalc). Команда «музыка» показывает Navidrome, библиотеку, Lidarr и наличие токена Яндекса. Ловушки: адрес CT 111 — 192.168.1.240; f-string ломается на шаблоне beets с фигурными скобками.
This commit is contained in:
1 parent
b9e1bf26b8
commit
7e0afefbe1
3 files changed
+252
No files matched your search
@@ -91,6 +91,26 @@ class MediaBot(Bot):
|
||||
tracks += len(files)
|
||||
lines.append(f"В библиотеке: {albums} альбомов, {tracks} треков")
|
||||
|
||||
# Lidarr
|
||||
try:
|
||||
import subprocess as _sp
|
||||
key = ""
|
||||
out = _sp.run(["pct", "exec", "111", "--", "docker", "exec", "lidarr", "sh", "-c",
|
||||
"grep -o '<ApiKey>[^<]*' /config/config.xml"],
|
||||
capture_output=True, text=True, timeout=25).stdout
|
||||
if "<ApiKey>" in out:
|
||||
key = out.split("<ApiKey>")[1].strip()
|
||||
if key:
|
||||
req = _rq.Request("http://192.168.1.240:8686/api/v1/system/status",
|
||||
headers={"X-Api-Key": key})
|
||||
with _rq.urlopen(req, timeout=10) as r:
|
||||
st = _json.loads(r.read() or b"{}")
|
||||
lines.append("Lidarr: версия " + str(st.get("version")))
|
||||
else:
|
||||
lines.append("Lidarr: ключ не получен")
|
||||
except Exception:
|
||||
lines.append("Lidarr: недоступен")
|
||||
|
||||
# Яндекс Музыка
|
||||
tok = "/root/.yandex-token"
|
||||
if _os.path.exists(tok):
|
||||
|
||||
Reference in new issue
Block a user