# Lscribe
[![Build Status](https://ci.codeberg.org/api/badges/16266/status.svg)](https://ci.codeberg.org/repos/16266)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Crates.io](https://img.shields.io/crates/v/lscribe)](https://crates.io/crates/lscribe)


CLI tool for download lyrics for you're local library.


## Features

- **Recursive directory scan** with -r flag
- **Fast lyrics fetching** with [LRCLib](https://lrclib.net) API
- **Writes lyrics** directly in music file, not just .lrc in folder (lscribe has fully supports ID3v2, Vorbis Comments and Mp4Ilst)
- **Word-level karaoke lyrics fetching** from [musixmatch.com](https://www.musixmatch.com/)


## TODO

- [x] Writes lyrics to a .lrc without writes in music file ( with another argument )
- [x] Directory support
- [ ] Docker image
- [ ] Write tests
- [ ] Copr repo (Fedora)


## Available Options

| Flag | Description |
| --- | --- |
| `-o, --output` | After downloading the lyrics, output them to the console  |
| `-w, --write-lrc-file` | Save `.lrc` file in the same folder  |
| `-p, --plain-only` | Fetch only plain lyrics, from [genius.com](https://genius.com/)  |
| `-e, --enhanced` | Searches for an [Enhanced](https://en.wikipedia.org/wiki/LRC_(file_format)#A2_extension:_word_time_tag:~:text=A2%20extension%20%28Enhanced%20LRC%20format%29%5Bedit%5D) (word-level karaoke) format from [musixmatch.com](https://www.musixmatch.com/). |
| `-R, --remove-empty-lines` | Remove empty lines from synced lyrics  |
| `-r, --recursive` | Recursive directory scan |

## Installation

```bash
cargo install lscribe
```

## Build

```bash
git clone https://codeberg.org/M23Snezhok/lscribe.git
cd lscribe
cargo build --release
```

## Usage (CLI)

Once compiled or installed, run it in the /release directory with an `.mp3`/`.flac`/`.opus`/`.wav`/`.ogg` or any audiofile or a folder with songs:

```bash
cd /target/release
./lscribe "/path/to/file_or_dir"
```

## Technologies Used

- [Rust](https://www.rust-lang.org/)
- [lofty-rs](https://github.com/Serial-ATA/lofty-rs)
- [LRCLib](https://lrclib.net) – open lyrics API


## License

Licensed under
* The MIT License ([MIT](https://codeberg.org/M23Snezhok/lscribe/src/branch/master/LICENSE) or https://opensource.org/license/mit)
