From bd96e6ec555c63ec6b24aaa681e9f02576551a27 Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Wed, 25 Sep 2024 11:06:21 +0200 Subject: update scrap --- scrap/api.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scrap/api.py') diff --git a/scrap/api.py b/scrap/api.py index af83bb7..5cc24d3 100644 --- a/scrap/api.py +++ b/scrap/api.py @@ -1,4 +1,6 @@ import lyricsgenius +import parser +import os genius = lyricsgenius.Genius( @@ -7,9 +9,13 @@ genius = lyricsgenius.Genius( def download_albums(albums): - [get_album_json(artist[0], album) for artist in albums for album in artist[1]] + [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) - return album.save_lyrics() + album.save_lyrics() -- cgit v1.2.3