nicole/nicole.1.md

135 lines
4.1 KiB
Markdown
Raw Permalink Normal View History

2024-05-02 23:34:27 +02:00
% NICOLE(1) nicole 2.1.0
2022-04-04 05:55:34 +02:00
% Matthias Quintern
2024-05-02 23:34:27 +02:00
% May 2024
2022-04-04 05:55:34 +02:00
# NAME
**N**ew-**I**ntrepid-**C**hief-**O**f-**L**yrics-**E**mbedders (obviously)
Nicole is a program that searches for lyrics and writes them into the mp3-tag of a file.
# SYNOPSIS
| Directory:
| **nicole** [OPTION...] -d DIRECTORY
| File:
| **nicole** [OPTION...] -f FILE
## Files
Nicole supports FLAC and mp3 files. Other files can not be edited (as of now).
Files that do not have a .flac or .mp3 extension are skipped automatically.
**mp3**: lyrics are stored in "USLT" tag as "lyrics- "
**flac**: lyrics are stored as vorbis-comment with key "LYRICS"
## History
Nicole creates a history of all files that were processed in `~/.configs/nicole`.
If a file is in the history, it will be skipped (unless `-i` is passed).
If the lyrics for a file can not be obtained, it is added to `~/.configs/nicole/failed_files`.
Those files are not skipped, the file only exists so that you can see which lyrics were not downloaded.
If you don't want your files in the history, add the `-n` option.
## genius
2022-04-04 06:14:47 +02:00
Nicole searches for lyrics using the genius api with the "title" and "artist" tags of the file.
2024-05-02 23:34:27 +02:00
If the title and artist names from genius are similar enough to the ones of the file,
the lyrics are scraped from the url obtained through the api.
2022-04-04 05:55:34 +02:00
## azlyrics
Nicole creates an azlyrics.com url from the "title" and "artist" tags of the file.
The lyrics are extracted from the html document using regex.
2024-05-02 23:34:27 +02:00
Unfortunately, there needs to be a 5 second delay between each request to azlyrics.com because
the site will block your ip for a while if you send many requests.
2022-04-04 05:55:34 +02:00
# USAGE
## Command line options
2024-05-02 23:34:27 +02:00
**--directory**, **-d** directory
2022-04-04 05:55:34 +02:00
: process directory [directory]
2024-05-02 23:34:27 +02:00
**--file**, **-f** file
2022-04-04 05:55:34 +02:00
: process file [file]
2024-05-02 23:34:27 +02:00
**--recursive**, **-r**
2022-04-04 05:55:34 +02:00
: go through directories recursively
2024-05-02 23:34:27 +02:00
**--silent**
2022-04-04 05:55:34 +02:00
: silent, no command-line output
2024-05-02 23:34:27 +02:00
**--ignore-history**, **-i**
2022-04-04 05:55:34 +02:00
: ignore history
2024-05-02 23:34:27 +02:00
**--no-history**, **-n**
2022-04-04 05:55:34 +02:00
: do not write to history
2024-05-02 23:34:27 +02:00
**--overwrite**, **-o**
2022-04-04 05:55:34 +02:00
: overwrite if the file already has lyrics
2024-05-02 23:34:27 +02:00
**--test**, **-t**
2022-04-04 05:55:34 +02:00
: test, do not write lyrics to file, but print to stdout
2024-05-02 23:34:27 +02:00
**--rm-explicit**
2022-04-04 05:55:34 +02:00
: remove the "[Explicit]" lyrics warning from the song's title tag
2024-05-02 23:34:27 +02:00
**--site**, **-s** site
2022-04-04 05:55:34 +02:00
: onlysearch [site] for lyrics (genius or azlyrics)
2024-05-02 23:34:27 +02:00
One of `--file` and `--directory` must be given at least once.
Example: `nicole -ior -d ~/music/artist --rm-explicit`
2022-04-04 05:55:34 +02:00
# INSTALLATION AND UPDATING
To update nicole, simply follow the installation instructions.
## pacman (Arch Linux)
2022-04-04 06:14:47 +02:00
Installing nicole using the Arch Build System also installs the man-page and a zsh completion script, if you have zsh installed.
2022-04-04 05:55:34 +02:00
```shell
git clone https://github.com/MatthiasQuintern/nicole.git
cd nicole
makepkg -si
```
## pip
2022-04-04 06:14:47 +02:00
You can also install nicole with python-pip:
2022-04-04 05:55:34 +02:00
```shell
git clone https://github.com/MatthiasQuintern/nicole.git
cd nicole
python3 -m pip install .
```
You can also install it system-wide using `sudo python3 -m pip install.`
If you also want to install the man-page and the zsh completion script:
```shell
sudo cp nicole.1.man /usr/share/man/man1/nicole.1
2022-04-04 06:14:47 +02:00
sudo gzip /usr/share/man/man1/nicole.1
2022-04-04 05:55:34 +02:00
sudo cp _nicole.compdef.zsh /usr/share/zsh/site-functions/_nicole
sudo chmod +x /usr/share/zsh/site-functions/_nicole
```
## Dependencies
2022-04-04 06:14:47 +02:00
- https://github.com/quodlibet/mutagen read and write mp3-tags
- https://www.crummy.com/software/BeautifulSoup deal with the html from genius
2022-04-04 05:55:34 +02:00
The dependencies will be automatically installed when using the either of the two installation options.
# CHANGELOG
2024-05-02 23:34:27 +02:00
## 2.1.0
- Refactoring:
- use argparse
- use pyproject.toml
- Ignore case when matching a genius result
2022-04-04 05:55:34 +02:00
## 2.0
- Nicole now supports lyrics from genius!
2024-05-01 22:49:59 +02:00
- Added man-page
- Added zsh-completion
2022-04-04 05:55:34 +02:00
## 1.1
- Lyrics are now properly encoded.
- If a title contains parenthesis or umlaute, multiple possible urls will be checked.
- Files are now processed in order
# COPYRIGHT
2024-05-02 23:34:27 +02:00
Copyright © 2024 Matthias Quintern. License GPLv3+: GNU GPL version 3 <https://gnu.org/licenses/gpl.html>.\
2022-04-04 05:55:34 +02:00
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.