Skip to content

Instantly share code, notes, and snippets.

@jq2
Created February 6, 2018 06:08
Show Gist options
  • Save jq2/c4e880244facf14d37074a2acc551f61 to your computer and use it in GitHub Desktop.
Save jq2/c4e880244facf14d37074a2acc551f61 to your computer and use it in GitHub Desktop.
Simple song lyrics downloader ( https://vagalume.com.br )
import os
import sys
from vagalume import lyrics
print('Starting the vagalume command-line interface')
while True:
d = str(input('>>> Enter the song artist: '))
print('[INFO] Searching for: %s' % d)
e = str(input('>>> Enter the song name/title: '))
song_finder = lyrics.find(d, e)
if song_finder.is_not_found():
print('[ERROR] Song not found!')
else:
print('Song: %s' % song_finder.song.name)
print('Artist: %s' % song_finder.artist.name)
get_lyrics = str(input('You want to download the lyrics ? Enter [Y/N]\n'))
if get_lyrics.upper() == 'Y':
print('Downloading song lyrics...')
song_lyric = song_finder.song.lyric
print('Lyrics length: %s' % len(song_lyric))
with open('/tmp/song_lyrics_001.txt', 'w') as f:
f.write(song_lyric)
exit(1)
else:
print('Bye!')
exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment