diff --git a/src/lyrics_.py b/src/lyrics_.py index 696c349..64cbc5c 100644 --- a/src/lyrics_.py +++ b/src/lyrics_.py @@ -4,6 +4,7 @@ import logging import os from lyrics import genius +from src.utils.shared import * """ This whole Part is bodgy as hell and I need to rewrite this little file urgently. genius.py is really clean though :3 @@ -56,7 +57,7 @@ def fetch_single_lyrics(row: dict): add_lyrics(file_, lyrics[0]) -def fetch_lyrics(database: db.Database): +def fetch_lyrics(): for row in database.get_custom_track([]): print(row['title']) fetch_single_lyrics(row) @@ -81,4 +82,4 @@ if __name__ == "__main__": db_logger, reset_anyways=False) - fetch_lyrics(database) + fetch_lyrics() diff --git a/src/metadata/download.py b/src/metadata/download.py index 0d9c7f2..0168d46 100644 --- a/src/metadata/download.py +++ b/src/metadata/download.py @@ -1,5 +1,5 @@ from src.utils.shared import * -from src.utils.object_handeling import get_elem_from_obj +from src.utils.object_handeling import get_elem_from_obj, parse_music_brainz_date from typing import List import musicbrainzngs @@ -51,8 +51,6 @@ class MetadataDownloader: for i, release_group in enumerate(release_groups): self.release_groups.append(MetadataDownloader.ReleaseGroup( - database, - logger, musicbrainz_releasegroupid=release_group['id'], artists=[self], albumsort=i + 1 diff --git a/src/scraping/youtube_music.py b/src/scraping/youtube_music.py index 495f0fb..f95930a 100644 --- a/src/scraping/youtube_music.py +++ b/src/scraping/youtube_music.py @@ -28,6 +28,9 @@ def get_youtube_from_isrc(isrc: str) -> List[dict]: def get_youtube_url(row): + if row['isrc'] is None: + return None + real_title = row['title'].lower() final_result = None diff --git a/src/utils/shared.py b/src/utils/shared.py index 52848d1..c33717a 100644 --- a/src/utils/shared.py +++ b/src/utils/shared.py @@ -26,7 +26,7 @@ temp_dir = os.path.join(tempfile.gettempdir(), TEMP_FOLDER) if not os.path.exists(temp_dir): os.mkdir(temp_dir) -mb_log = logging.getLogger("musicbrainzngs").setLevel(logging.WARNING) +logging.getLogger("musicbrainzngs").setLevel(logging.WARNING) musicbrainzngs.set_useragent("metadata receiver", "0.1", "https://github.com/HeIIow2/music-downloader")