Add an option to prepend lyrics source header
This commit is contained in:
parent
d651894413
commit
4bfcbf17bd
5 changed files with 8 additions and 1 deletions
|
@ -118,6 +118,7 @@ As an example, to enable the `musixmatch` provider, you'll need to [acquire a Mu
|
||||||
[providers]
|
[providers]
|
||||||
order = ["musixmatch", "kugou"]
|
order = ["musixmatch", "kugou"]
|
||||||
delay = 10 # Seconds to wait between searches
|
delay = 10 # Seconds to wait between searches
|
||||||
|
prepend_header = true # Prepend lyrics-dl's & provider's header to keep track of lyrics source
|
||||||
|
|
||||||
[providers.musixmatch]
|
[providers.musixmatch]
|
||||||
token = "YOUR_TOKEN"
|
token = "YOUR_TOKEN"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[providers]
|
[providers]
|
||||||
order = ["musixmatch", "kugou"]
|
order = ["musixmatch", "kugou"]
|
||||||
delay = 10
|
delay = 10
|
||||||
|
prepend_header = true
|
||||||
|
|
||||||
[providers.musixmatch]
|
[providers.musixmatch]
|
||||||
token = "123456"
|
token = "123456"
|
||||||
|
|
|
@ -51,6 +51,10 @@ class LyricsDl:
|
||||||
|
|
||||||
if lyrics:
|
if lyrics:
|
||||||
self.logger.info(f"[{provider.name}] Found lyrics!")
|
self.logger.info(f"[{provider.name}] Found lyrics!")
|
||||||
|
|
||||||
|
if self.config.prepend_header:
|
||||||
|
lyrics = f"[re:lyrics-dl:{provider.name}]\n\n{lyrics}"
|
||||||
|
|
||||||
return lyrics
|
return lyrics
|
||||||
|
|
||||||
self.logger.info(f"[{provider.name}] No lyrics was found!")
|
self.logger.info(f"[{provider.name}] No lyrics was found!")
|
||||||
|
|
|
@ -23,6 +23,7 @@ CONFIG_PATH = _get_config_file()
|
||||||
class LyricsDlConfig:
|
class LyricsDlConfig:
|
||||||
order: list[str] = field(default_factory=lambda: ["kugou", "youtube"])
|
order: list[str] = field(default_factory=lambda: ["kugou", "youtube"])
|
||||||
delay: float | None = 10
|
delay: float | None = 10
|
||||||
|
prepend_header: bool = True
|
||||||
providers_configs: dict[str, dict] = field(default_factory=lambda: {})
|
providers_configs: dict[str, dict] = field(default_factory=lambda: {})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='lyrics_dl',
|
name='lyrics_dl',
|
||||||
version='0.0.2',
|
version='0.0.3',
|
||||||
description='An ultimate cli tool for downloading song lyrics, inspired by other awesome *-dl programs.',
|
description='An ultimate cli tool for downloading song lyrics, inspired by other awesome *-dl programs.',
|
||||||
packages=[
|
packages=[
|
||||||
"lyrics_dl",
|
"lyrics_dl",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue