diff options
author | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-09-24 12:21:40 +0200 |
---|---|---|
committer | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-09-24 12:21:40 +0200 |
commit | 2e8ddbf422a3a6d75b1e1f73cad089111f801c05 (patch) | |
tree | a3b2c7ea8560fcbc89fb9b3ee15933d434b1ff51 /scrap/api.py | |
parent | faa13839f898c60ff5618be6e916ad2e60958468 (diff) |
finished web scrapper
Diffstat (limited to 'scrap/api.py')
-rw-r--r-- | scrap/api.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scrap/api.py b/scrap/api.py new file mode 100644 index 0000000..af83bb7 --- /dev/null +++ b/scrap/api.py @@ -0,0 +1,15 @@ +import lyricsgenius + + +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): + album = genius.search_album(album_name, artist_name) + return album.save_lyrics() |