This commit is contained in:
Lars Noack 2022-10-21 11:48:48 +02:00
parent e0fb122f4f
commit 0c64bccc98
3 changed files with 7 additions and 0 deletions

View File

@ -1,12 +1,18 @@
import os.path
import logging
import musicbrainzngs
import pandas as pd
mb_log = logging.getLogger("musicbrainzngs")
mb_log.setLevel(logging.WARNING)
musicbrainzngs.set_useragent("metadata receiver", "0.1", "https://github.com/HeIIow2/music-downloader")
KNOWN_KIND_OF_OPTIONS = ["artist", "release", "track"]
def output(msg: str):
print(msg)
def get_elem_from_obj(current_object, keys: list, after_process=lambda x: x):
current_object = current_object
for key in keys:
@ -61,6 +67,7 @@ class Search:
"""
metadata_list = []
result = musicbrainzngs.get_artist_by_id(mb_id, includes=["releases"])
for i, release in enumerate(result["artist"]["release-list"]):
metadata_list.extend(self.download_release(release["id"], i))