finish renaming

This commit is contained in:
2026-03-31 22:34:15 +02:00
parent 4d48e21533
commit 88cf0115af
56 changed files with 35 additions and 35 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
{
"python-envs.defaultEnvManager": "ms-python.python:system"
"python-envs.defaultEnvManager": "ms-python.python:venv"
}
+17 -17
View File
@@ -1,4 +1,4 @@
# lrcfetch
# LRX-CLI
A CLI tool for fetching LRC lyrics on Linux. Automatically detects the currently playing track via MPRIS/DBus and retrieves synced (or plain with all time tags set to `[00:00.00]` if failed to find any synced) lyrics from multiple sources.
@@ -16,76 +16,76 @@ Lyrics are fetched using a fallback pipeline (first synced result wins):
## Usage
See `lrcfetch --help` for full command reference. Common use cases:
See `lrx --help` for full command reference. Common use cases:
- Fetch lyrics for the currently playing track:
```bash
lrcfetch fetch
lrx fetch
```
using a specific player or source to fetch from:
```bash
lrcfetch --player mpd fetch --method lrclib-search
lrx --player mpd fetch --method lrclib-search
```
- Search by metadata (bypasses MPRIS):
```bash
lrcfetch search -t "My Love" -a "Westlife"
lrcfetch search --trackid "5p0ietGkLNEqx1Z7ijkw5g"
lrx search -t "My Love" -a "Westlife"
lrx search --trackid "5p0ietGkLNEqx1Z7ijkw5g"
```
or for a local file:
```bash
lrcfetch search --path "/path/to/Westlife - My Love.flac"
lrx search --path "/path/to/Westlife - My Love.flac"
```
- Export to sidecar `.lrc` file:
```bash
lrcfetch export
lrx export
```
or to a custom path:
```bash
lrcfetch export --output /path/to/lyrics.lrc
lrx export --output /path/to/lyrics.lrc
```
- Cache management:
```bash
lrcfetch cache stats # show cache statistics
lrcfetch cache query # query cache for current track
lrcfetch cache clear # clears cache of current track
lrcfetch cache clear --all # clears entire cache
lrx cache stats # show cache statistics
lrx cache query # query cache for current track
lrx cache clear # clears cache of current track
lrx cache clear --all # clears entire cache
```
## Configuration
Set credentials via environment variable or `.env` file:
- `~/.config/lrcfetch/.env` — user-level
- `~/.config/lrx/.env` — user-level
- `.env` in working directory — project-local
- Shell environment — highest priority
```env
SPOTIFY_SP_DC=your_cookie_value
QQ_MUSIC_API_URL=https://api.example.com
LRCFETCH_PLAYER=spotify
PREFERRED_PLAYER=spotify
```
- `SPOTIFY_SP_DC` — required for Spotify source. Defaults to empty (disabled Spotify source).
- `QQ_MUSIC_API_URL` — required for QQ Music source. Defaults to empty (disabled QQ Music source).
- `LRCFETCH_PLAYER` — preferred MPRIS player when multiple are active. Defaults to `spotify`. Only used when no `--player` flag is given and more than one player (or none of them) is currently playing.
- `PREFERRED_PLAYER` — preferred MPRIS player when multiple are active. Defaults to `spotify`. Only used when no `--player` flag is given and more than one player (or none of them) is currently playing.
Shell completion (zsh/fish/bash):
```bash
lrcfetch --install-completion
lrx --install-completion
```
## Credits
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,4 +1,4 @@
from lrx.cli import run
from lrx_cli.cli import run
if __name__ == "__main__":
run()
View File
+1 -1
View File
@@ -22,7 +22,7 @@ from .lrc import get_sidecar_path
app = cyclopts.App(
help="LRCFetch — Fetch line-synced lyrics for your music player.",
help="LRX-CLI — Fetch line-synced lyrics for your music player.",
)
app.register_install_completion_command()
+4 -4
View File
@@ -13,7 +13,7 @@ from loguru import logger
from importlib.metadata import version
# Application
APP_NAME = "lrcfetch"
APP_NAME = "lrx-cli"
APP_AUTHOR = "Uyanide"
APP_VERSION = version(APP_NAME)
@@ -23,7 +23,7 @@ DB_PATH = os.path.join(CACHE_DIR, "cache.db")
# .env loading
_config_env = Path(user_config_dir(APP_NAME, APP_AUTHOR)) / ".env"
load_dotenv(_config_env) # ~/.config/lrcfetch/.env
load_dotenv(_config_env) # ~/.config/lrx-cli/.env
load_dotenv() # .env in cwd (does NOT override existing vars)
# HTTP
@@ -62,11 +62,11 @@ LRCLIB_SEARCH_URL = "https://lrclib.net/api/search"
QQ_MUSIC_API_URL = os.environ.get("QQ_MUSIC_API_URL", "").rstrip("/")
# Player preference (used when multiple MPRIS players are active)
PREFERRED_PLAYER = os.environ.get("LRCFETCH_PLAYER", "spotify")
PREFERRED_PLAYER = os.environ.get("PREFERRED_PLAYER", "spotify")
# User-Agents
UA_BROWSER = "Mozilla/5.0 (X11; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0"
UA_LRCFETCH = f"LRCFetch {APP_VERSION} (https://github.com/Uyanide/lrcfetch)"
UA_LRX = f"LRX-CLI {APP_VERSION} (https://github.com/Uyanide/lrx-cli)"
os.makedirs(CACHE_DIR, exist_ok=True)
View File
@@ -22,7 +22,7 @@ from ..config import (
TTL_NOT_FOUND,
TTL_NETWORK_ERROR,
LRCLIB_API_URL,
UA_LRCFETCH,
UA_LRX,
)
@@ -54,7 +54,7 @@ class LrclibFetcher(BaseFetcher):
try:
with httpx.Client(timeout=HTTP_TIMEOUT) as client:
resp = client.get(url, headers={"User-Agent": UA_LRCFETCH})
resp = client.get(url, headers={"User-Agent": UA_LRX})
if resp.status_code == 404:
logger.debug(f"LRCLIB: not found for {track.display_name()}")
@@ -24,7 +24,7 @@ from ..config import (
TTL_NETWORK_ERROR,
DURATION_TOLERANCE_MS,
LRCLIB_SEARCH_URL,
UA_LRCFETCH,
UA_LRX,
)
@@ -55,7 +55,7 @@ class LrclibSearchFetcher(BaseFetcher):
try:
with httpx.Client(timeout=HTTP_TIMEOUT) as client:
resp = client.get(url, headers={"User-Agent": UA_LRCFETCH})
resp = client.get(url, headers={"User-Agent": UA_LRX})
if resp.status_code != 200:
logger.error(f"LRCLIB-search: API returned {resp.status_code}")
View File
View File
+4 -4
View File
@@ -8,8 +8,8 @@ import asyncio
from dbus_next.aio.message_bus import MessageBus
from dbus_next.constants import BusType
from dbus_next.message import Message
from lrx.models import TrackMeta
from lrx.config import PREFERRED_PLAYER
from lrx_cli.models import TrackMeta
from lrx_cli.config import PREFERRED_PLAYER
from loguru import logger
from typing import Optional, List, Any
@@ -59,7 +59,7 @@ async def _select_player(
When specific_player is given, filter by name match.
Otherwise: prefer the currently playing player. If multiple are playing,
prefer the one matching LRCFETCH_PLAYER env var (default: spotify).
prefer the one matching PREFERRED_PLAYER env var (default: spotify).
"""
players = await _list_mpris_players(bus)
if not players:
@@ -82,7 +82,7 @@ async def _select_player(
if len(candidates) == 1:
return candidates[0]
# Multiple candidates: prefer LRCFETCH_PLAYER
# Multiple candidates: prefer PREFERRED_PLAYER
preferred = PREFERRED_PLAYER.lower()
if preferred:
for p in candidates:
+1 -1
View File
@@ -1,4 +1,4 @@
from lrx.cli import run
from lrx_cli.cli import run
if __name__ == "__main__":
run()
+1 -1
View File
@@ -19,7 +19,7 @@ dependencies = [
]
[project.scripts]
lrx = "lrx.cli:run"
lrx = "lrx_cli.cli:run"
[tool.ruff.lint]
ignore = ["E402"]
Generated
+1 -1
View File
@@ -143,7 +143,7 @@ wheels = [
]
[[package]]
name = "lrcfetch"
name = "lrx-cli"
version = "0.1.7"
source = { editable = "." }
dependencies = [