diff --git a/LICENSE b/LICENSE index 608e505..718efc6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,11 @@ -Copyright 2026 Uyanide pywang0608@foxmail.com +Copyright 2026 Uyanide -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 5464777..3b9be18 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,40 @@ -> [!WARNING] -> -> This project is provided for educational and experimental purposes only. It is not intended for production or commercial use and may violate the terms of service of third‑party music platforms. Use of this software is at your own risk; the authors provide no warranties and accept no liability for any consequences arising from its use. - # LRX-CLI -A CLI tool for fetching LRC lyrics on Linux. Automatically detects the currently playing track via MPRIS/DBus and retrieves the best-matching lyrics from multiple sources, ranked by confidence scoring. +> [!WARNING] +> +> This project is primarily provided for educational and experimental purposes. +> It is yet not ready for production or commercial use and may violate the terms +> of service (ToS) of third‑party music platforms. Use of this software is at +> your own risk; the authors provide no warranties and accept no liability for any +> consequences arising from its use. + +A CLI tool for fetching LRC lyrics on Linux. Automatically detects the currently +playing track via MPRIS/DBus and retrieves the best-matching lyrics from +multiple sources, ranked by confidence scoring. ## Sources -Sources are queried in order. High-confidence results (exact match or manual insert) terminate the pipeline early; otherwise all sources are tried and the highest-confidence result wins. +Sources are queried in order. High-confidence results (exact match or manual +insert) terminate the pipeline early; otherwise all sources are tried and the +highest-confidence result wins. 1. **Local** — sidecar `.lrc` files or embedded audio metadata (FLAC, MP3) 2. **Cache Search** — fuzzy cross-album lookup in local cache -3. **Spotify** — synced lyrics via Spotify's API (requires `SPOTIFY_SP_DC` and Spotify trackid) -4. **LRCLIB** — exact match from [lrclib.net](https://lrclib.net) (requires full metadata) -5. **Musixmatch (Spotify)** — Musixmatch API with Spotify trackid (requires Spotify trackid) +3. **Spotify** — synced lyrics via Spotify's API + (requires `SPOTIFY_SP_DC` and Spotify trackid) +4. **LRCLIB** — exact match from [lrclib.net](https://lrclib.net) + (requires full metadata) +5. **Musixmatch (Spotify)** — Musixmatch API with Spotify trackid + (requires Spotify trackid) 6. **LRCLIB Search** — fuzzy search from lrclib.net (requires at least a title) 7. **Musixmatch** — Musixmatch API with metadata search (requires at least a title) 8. **Netease** — Netease Cloud Music public API -9. **QQ Music** — QQ Music via self-hosted API proxy (requires `QQ_MUSIC_API_URL` that provides the same interface as [tooplick/qq-music-api](https://github.com/tooplick/qq-music-api)) +9. **QQ Music** — QQ Music via self-hosted API proxy + (requires `QQ_MUSIC_API_URL` that provides the same interface as [tooplick/qq-music-api](https://github.com/tooplick/qq-music-api)) -> I'm aware that Spotify's lyrics are provided by Musixmatch, but the fact is that Musixmatch's own search will yield different (and more) results than Spotify's, so I treat them as separate sources. +> I'm aware that Spotify's lyrics are provided by Musixmatch, but the fact is +> that Musixmatch's own search will yield different (and more) results than +> Spotify's, so I treat them as separate sources. ## Usage @@ -62,7 +76,7 @@ See `lrx --help` for full command reference. Common use cases: - Cache management: ```bash - lrx cache stats # statistics with source×status table and confidence distribution + lrx cache stats # statistics lrx cache query # inspect cache entries for current track lrx cache clear # clear cache of current track lrx cache clear --all # clear entire cache @@ -84,10 +98,18 @@ QQ_MUSIC_API_URL=https://api.example.com PREFERRED_PLAYER=spotify ``` -- `SPOTIFY_SP_DC` — required for Spotify source. Defaults to empty (disabled Spotify source). -- `MUSIXMATCH_USERTOKEN` — optional for Musixmatch sources ([Curators Settings Page](https://curators.musixmatch.com/settings) -> Login (if required) -> "Copy debug info"). If not set, an anonymous token will be fetched at runtime. -- `QQ_MUSIC_API_URL` — required for QQ Music source. Defaults to empty (disabled QQ Music source). -- `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. +- `SPOTIFY_SP_DC` — required for Spotify source. Defaults to empty + (disabled Spotify source). +- `MUSIXMATCH_USERTOKEN` — optional for Musixmatch sources + ([Curators Settings Page](https://curators.musixmatch.com/settings) + -> Login (if required) + -> "Copy debug info"). + If not set, an anonymous token will be fetched at runtime. +- `QQ_MUSIC_API_URL` — required for QQ Music source. Defaults to empty + (disabled QQ Music source). +- `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):