From 0972fa6eab8c9111311f082ba8abfdc6b4a40945 Mon Sep 17 00:00:00 2001 From: nil Date: Wed, 2 Oct 2024 17:48:56 +0200 Subject: commit changes --- scripts/populate/api.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/populate/api.py (limited to 'scripts/populate/api.py') diff --git a/scripts/populate/api.py b/scripts/populate/api.py new file mode 100644 index 0000000..5cc24d3 --- /dev/null +++ b/scripts/populate/api.py @@ -0,0 +1,21 @@ +import lyricsgenius +import parser +import os + + +genius = lyricsgenius.Genius( + "0uSA9UFGsiO2WozVmbWPhyhOoVmUNuM3PXRt9rvWhptHBMgSO5CZBxGUMkwet5mv" +) + + +def download_albums(albums): + [get_album_json(artist[0], album) + for artist in albums for album in artist[1]] + + +def get_album_json(artist_name, album_name): + if os.path.isfile(parser.getLink(album_name)): + return + + album = genius.search_album(album_name, artist_name) + album.save_lyrics() -- cgit v1.2.3