summaryrefslogtreecommitdiff
path: root/scrap/api.py
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-09-25 11:06:21 +0200
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-09-25 11:06:21 +0200
commitbd96e6ec555c63ec6b24aaa681e9f02576551a27 (patch)
tree90c92be4cb4237720008912efbf159ae4a2a681f /scrap/api.py
parent8cbd3d92ac1a30ecbbb60929a3430c9f29671b3f (diff)
update scrap
Diffstat (limited to 'scrap/api.py')
-rw-r--r--scrap/api.py10
1 files changed, 8 insertions, 2 deletions
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()