Added Deezer and TheAudioDB as metadata providers

This commit is contained in:
krateng 2021-11-27 19:19:58 +01:00
parent 898dd9735c
commit a41aa0962b
4 changed files with 42 additions and 2 deletions

View File

@ -28,7 +28,7 @@ FORCE_PASSWORD = none
# order in which to use the metadata providers
# keep in mind that musicbrainz is rate-limited and should probably not be used first
METADATA_PROVIDERS = [lastfm,spotify,musicbrainz]
METADATA_PROVIDERS = [lastfm,spotify,deezer,musicbrainz]
# whether to proxy scrobble to other services
SCROBBLE_LASTFM = false

View File

@ -220,7 +220,9 @@ def b64(inp):
__all__ = [
"lastfm",
"spotify",
"musicbrainz"
"musicbrainz",
"audiodb",
"deezer"
]
from . import *

21
maloja/thirdparty/audiodb.py vendored Normal file
View File

@ -0,0 +1,21 @@
from . import MetadataInterface
class AudioDB(MetadataInterface):
name = "TheAudioDB"
identifier = "audiodb"
settings = {
"api_key":"AUDIODB_API_KEY"
}
metadata = {
#"trackurl": "https://theaudiodb.com/api/v1/json/{api_key}/searchtrack.php?s={artist}&t={title}",
"artisturl": "https://www.theaudiodb.com/api/v1/json/{api_key}/search.php?s={artist}",
"response_type":"json",
#"response_parse_tree_track": ["tracks",0,"astrArtistThumb"],
"response_parse_tree_artist": ["artists",0,"strArtistThumb"],
"required_settings": ["api_key"],
}
def get_image_track(self,artist):
return None

17
maloja/thirdparty/deezer.py vendored Normal file
View File

@ -0,0 +1,17 @@
from . import MetadataInterface
class Deezer(MetadataInterface):
name = "Deezer"
identifier = "deezer"
settings = {
}
metadata = {
"trackurl": "https://api.deezer.com/search?q={artist}%20{title}",
"artisturl": "https://api.deezer.com/search?q={artist}",
"response_type":"json",
"response_parse_tree_track": ["data",0,"album","cover_medium"],
"response_parse_tree_artist": ["data",0,"artist","picture_medium"],
"required_settings": [],
}