@@ -10,17 +10,19 @@ and, optionally, the Google custom search API.
10
10
.. _LRCLIB : https://lrclib.net/
11
11
12
12
13
- Fetch Lyrics During Import
14
- --------------------------
13
+ Install
14
+ -------
15
15
16
- To automatically fetch lyrics for songs you import, first enable it in your
17
- configuration (see :ref: `using-plugins `). Then, install ``beets `` with
18
- ``lyrics `` extra
16
+ Firstly, enable ``lyrics `` plugin in your configuration (see
17
+ :ref: `using-plugins `). Then, install ``beets `` with ``lyrics `` extra
19
18
20
19
.. code-block :: bash
21
20
22
21
pip install " beets[lyrics]"
23
22
23
+ Fetch Lyrics During Import
24
+ --------------------------
25
+
24
26
When importing new files, beets will now fetch lyrics for files that don't
25
27
already have them. The lyrics will be stored in the beets database. If the
26
28
``import.write `` config option is on, then the lyrics will also be written to
@@ -30,45 +32,49 @@ Configuration
30
32
-------------
31
33
32
34
To configure the plugin, make a ``lyrics: `` section in your
33
- configuration file. The available options are:
35
+ configuration file. Default configuration:
36
+
37
+ .. code-block :: yaml
38
+
39
+ lyrics :
40
+ auto : yes
41
+ bing_client_secret : null
42
+ bing_lang_from : []
43
+ bing_lang_to : null
44
+ fallback : null
45
+ force : no
46
+ google_API_key : null
47
+ google_engine_ID : 009217259823014548361:lndtuqkycfu
48
+ sources :
49
+ - lrclib
50
+ - google
51
+ - genius
52
+ - tekstowo
53
+ synced : no
54
+
55
+ The available options are:
34
56
35
57
- **auto **: Fetch lyrics automatically during import.
36
- Default: ``yes ``.
37
58
- **bing_client_secret **: Your Bing Translation application password
38
- (to :ref: `lyrics-translation `)
59
+ (see :ref: `lyrics-translation `)
39
60
- **bing_lang_from **: By default all lyrics with a language other than
40
61
``bing_lang_to `` are translated. Use a list of lang codes to restrict the set
41
62
of source languages to translate.
42
- Default: ``[] ``
43
63
- **bing_lang_to **: Language to translate lyrics into.
44
- Default: None.
45
64
- **fallback **: By default, the file will be left unchanged when no lyrics are
46
65
found. Use the empty string ``'' `` to reset the lyrics in such a case.
47
- Default: None.
48
66
- **force **: By default, beets won't fetch lyrics if the files already have
49
67
ones. To instead always fetch lyrics, set the ``force `` option to ``yes ``.
50
- Default: ``no ``.
51
68
- **google_API_key **: Your Google API key (to enable the Google Custom Search
52
69
backend).
53
- Default: None.
54
70
- **google_engine_ID **: The custom search engine to use.
55
71
Default: The `beets custom search engine `_, which gathers an updated list of
56
72
sources known to be scrapeable.
57
73
- **sources **: List of sources to search for lyrics. An asterisk ``* `` expands
58
- to all available sources.
59
- Default: ``lrclib google genius tekstowo ``, i.e., all the available sources. The
60
- ``google `` source will be automatically deactivated if no ``google_API_key ``
61
- is setup.
62
- The ``google ``, ``genius ``, and ``tekstowo `` sources will only be enabled if
63
- BeautifulSoup is installed.
64
- - **synced **: Prefer synced lyrics over plain lyrics if a source offers them. Currently `lrclib ` is the only source that provides them. Default: `no `.
65
-
66
- Here's an example of ``config.yaml ``::
67
-
68
- lyrics:
69
- fallback: ''
70
- google_API_key: AZERTYUIOPQSDFGHJKLMWXCVBN1234567890_ab
71
- google_engine_ID: 009217259823014548361:lndtuqkycfu
74
+ to all available sources. The ``google `` source will be automatically
75
+ deactivated if no ``google_API_key `` is setup.
76
+ - **synced **: Prefer synced lyrics over plain lyrics if a source offers them.
77
+ Currently ``lrclib `` is the only source that provides them.
72
78
73
79
.. _beets custom search engine : https://www.google.com:443/cse/publicurl?cx=009217259823014548361:lndtuqkycfu
74
80
@@ -83,46 +89,52 @@ by that band, and ``beet lyrics`` will get lyrics for my entire library. The
83
89
lyrics will be added to the beets database and, if ``import.write `` is on,
84
90
embedded into files' metadata.
85
91
86
- The ``-p `` option to the ``lyrics `` command makes it print lyrics out to the
87
- console so you can view the fetched (or previously-stored) lyrics.
92
+ The ``-p, --print `` option to the ``lyrics `` command makes it print lyrics out
93
+ to the console so you can view the fetched (or previously-stored) lyrics.
88
94
89
- The ``-f `` option forces the command to fetch lyrics, even for tracks that
90
- already have lyrics. Inversely, the ``-l `` option restricts operations
91
- to lyrics that are locally available, which show lyrics faster without using
92
- the network at all.
95
+ The ``-f, --force `` option forces the command to fetch lyrics, even for tracks
96
+ that already have lyrics. Inversely, the ``-l, --local `` option restricts
97
+ operations to lyrics that are locally available, which show lyrics faster
98
+ without using the network at all.
93
99
94
100
Rendering Lyrics into Other Formats
95
101
-----------------------------------
96
102
97
- The ``-r directory `` option renders all lyrics as ` reStructuredText `_ (ReST)
98
- documents in ``directory `` (by default, the current directory). That
99
- directory, in turn, can be parsed by tools like `Sphinx `_ to generate HTML,
100
- ePUB, or PDF documents.
103
+ The ``-r directory, --write-rest directory `` option renders all lyrics as
104
+ ` reStructuredText `_ (ReST) documents in ``directory `` (by default, the current
105
+ directory). That directory , in turn, can be parsed by tools like `Sphinx `_ to
106
+ generate HTML, ePUB, or PDF documents.
101
107
102
108
A minimal ``conf.py `` and ``index.rst `` files are created the first time the
103
109
command is run. They are not overwritten on subsequent runs, so you can safely
104
110
modify these files to customize the output.
105
111
106
- .. _Sphinx : https://www.sphinx-doc.org/
107
- .. _reStructuredText : http://docutils.sourceforge.net/rst.html
108
-
109
112
Sphinx supports various `builders
110
113
<https://www.sphinx-doc.org/en/stable/builders.html> `_, but here are a
111
114
few suggestions.
112
115
113
- * Build an HTML version::
114
116
115
- sphinx-build -b html . _build/html
117
+ .. admonition :: Build an HTML version
118
+
119
+ ::
116
120
117
- * Build an ePUB3 formatted file, usable on ebook readers::
121
+ sphinx-build -b html . _build/html
118
122
119
- sphinx-build -b epub3 . _build/epub
123
+ .. admonition :: Build an ePUB3 formatted file, usable on ebook readers
120
124
121
- * Build a PDF file, which incidentally also builds a LaTeX file ::
125
+ ::
122
126
123
- sphinx-build -b latex %s _build/latex && make -C _build/latex all-pdf
127
+ sphinx-build -b epub3 . _build/epub
124
128
125
- .. _activate-google-custom-search :
129
+ .. admonition :: Build a PDF file, which incidentally also builds a LaTeX file
130
+
131
+ ::
132
+
133
+ sphinx-build -b latex %s _build/latex && make -C _build/latex all-pdf
134
+
135
+
136
+ .. _Sphinx : https://www.sphinx-doc.org/
137
+ .. _reStructuredText : http://docutils.sourceforge.net/rst.html
126
138
127
139
Activate Google Custom Search
128
140
------------------------------
@@ -134,24 +146,22 @@ default list, which includes it as long as you have an API key).
134
146
If you use default ``google_engine_ID ``, we recommend limiting the sources to
135
147
``google `` as the other sources are already included in the Google results.
136
148
137
- .. _register for a Google API key : https://console.developers.google.com/
138
-
139
149
Optionally, you can `define a custom search engine `_. Get your search engine's
140
150
token and use it for your ``google_engine_ID `` configuration option. By
141
151
default, beets use a list of sources known to be scrapeable.
142
152
143
- .. _define a custom search engine : https://www.google.com/cse/all
144
-
145
153
Note that the Google custom search API is limited to 100 queries per day.
146
154
After that, the lyrics plugin will fall back on other declared data sources.
147
155
148
- .. _BeautifulSoup : https://www.crummy.com/software/BeautifulSoup/bs4/doc/
149
-
150
156
Activate Genius and Tekstowo.pl Lyrics
151
157
--------------------------------------
152
158
153
159
These backends are enabled by default.
154
160
161
+ .. _register for a Google API key : https://console.developers.google.com/
162
+ .. _define a custom search engine : https://www.google.com/cse/all
163
+
164
+
155
165
.. _lyrics-translation :
156
166
157
167
Activate On-the-Fly Translation
@@ -161,6 +171,6 @@ You need to register for a Microsoft Azure Marketplace free account and
161
171
to the `Microsoft Translator API `_. Follow the four steps process, specifically
162
172
at step 3 enter ``beets `` as *Client ID * and copy/paste the generated
163
173
*Client secret * into your ``bing_client_secret `` configuration, alongside
164
- ``bing_lang_to `` target `language code `.
174
+ ``bing_lang_to `` target `` language code ` `.
165
175
166
176
.. _Microsoft Translator API : https://docs.microsoft.com/en-us/azure/cognitive-services/translator/translator-how-to-signup
0 commit comments