def getLyrics(): lyrics = songs.searchSong(artist, title, "lyrics") for lyric in lyrics: r = re.search(r'\[(.+?)\]', lyric) # if r == None: if r != None: # print lyric delete = r.group(0) lyric = lyric.replace(delete, '') rnew = re.search(r'\[(.+?)\]', lyric) if rnew != None: deletenew = rnew.group(0) lyric = lyric.replace(deletenew, '') else: pass else: pass lyric = lyric.replace('\n', ' ').replace('(', '').replace(')', '').replace(',', '').replace('-', ' ').replace('...', '') lyric = lyric.strip() words = lyric.split(' ') for word in words: if word != '': song.append(word) for i in range(10): song.append(" ") print "Song collected!"
###grab albums for an artist### records1 = artists.albumList('Pusha T') for record in records1: print record ###getting dates for albums### records2 = artists.getDates('Nicki Minaj') for record in records2: print record ###searching through songs for just the lyrics### lyrics = songs.searchSong('lil wayne', 'mrs officer', 'lyrics') for lyric in lyrics: print lyric ###searching through songs for annotations### annotated = songs.searchSong('drake', 'started from the bottom') n = len(annotated) for i in range(0,n): lyric = annotated[i][0] link = annotated[i][1] #print notes if link != "Not annotated":
###grab albums for an artist### records1 = artists.albumList('Pusha T') for record in records1: print record ###getting dates for albums### records2 = artists.getDates('Nicki Minaj') for record in records2: print record ###searching through songs for just the lyrics### lyrics = songs.searchSong('lil wayne', 'got money', 'lyrics') for lyric in lyrics: print lyric ###searching through songs for annotations### annotated = songs.searchSong('drake', 'started from the bottom') n = len(annotated) for i in range(0,n): lyric = annotated[i][0] link = annotated[i][1] #print notes if link != "Not annotated":
print data[0] #returns first result ###grab albums for an artist### records1 = artists.albumList('Pusha T') for record in records1: print record ###getting dates for albums### records2 = artists.getDates('Nicki Minaj') for record in records2: print record ###searching through songs for just the lyrics### lyrics = songs.searchSong('lil wayne', 'mrs officer', 'lyrics') for lyric in lyrics: print lyric ###searching through songs for annotations### annotated = songs.searchSong('drake', 'started from the bottom') n = len(annotated) for i in range(0, n): lyric = annotated[i][0] link = annotated[i][1] #print notes if link != "Not annotated": note = songs.searchAnnotations(link)