songs2slides

A tool that automatically finds song lyrics and creates lyric slideshows
git clone https://git.ashermorgan.net/songs2slides/
Log | Files | Refs | README

commit 67211ce4c2aabb2e87daf24b0fb0a80ecb1a4c6a
parent 39463b3cd7729630c1c7f6f89ebf10ae982af89d
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date:   Sat, 21 Mar 2020 09:12:52 -0700

Implement getLyrics.

Diffstat:
ASongs2Slides.py | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/Songs2Slides.py b/Songs2Slides.py @@ -0,0 +1,13 @@ +# Import dependencies +from bs4 import BeautifulSoup +import requests + + +# Gets the lyrics +def getLyrics(artist, song): + artist = artist.replace(" ", "-") + song = song.replace(" ", "-") + page = requests.get("https://genius.com/{0}-{1}-lyrics".format(artist, song)) + html = BeautifulSoup(page.text, 'html.parser') + lyrics = html.find('div', class_='lyrics').get_text() + return lyrics +\ No newline at end of file