Example #1
0
    def all_songs(self):
        if self.cached_all_songs is None:
            logger.info(f'Retrieving all songs by: {self.name}')

            api = AZlyrics()
            api.artist = self.name
            all_songs = api.getSongs()

            logger.info(f'Retrieved {len(all_songs)} songs')

            self.cached_all_songs = [
                Song.entitled(songs.model.SongTitle(self.name, song))
                for song in all_songs.keys()
            ]

        return self.cached_all_songs
Example #2
0
 def text(self):
     logger.info(f'Retrieving lyrics: {self.title}')
     api = AZlyrics()
     api.artist = self.title.artist
     api.title = self.title.title
     api.getLyrics()
     return api.lyrics
Example #3
0
def get_lyric(singer, song):
    API = AZlyrics('google', accuracy=0.5)
    API.artist = singer
    API.title = song
    API.getLyrics()

    return API.lyrics
Example #4
0
from azapi import AZlyrics

api = AZlyrics()

# We are Searching for Meghan's song "All about that bass"
songs = api.search('about the bass', category = 'songs')

# Song appears to be the first in search results
song_url = songs[0]['url']

Lyrics = api.getLyrics(url = song_url)

print(Lyrics)
Example #5
0
              'of lyrics?')
        print('1. Google')
        print('2. DuckDuckGo')
        az_se = input(': ')
        print()

        while not az_se in ['1', '2']:
            print('Please specify the search engine.')
            print('Or type "q" to exit.')
            az_se = input(': ')
            print()
            if az_se == 'q':
                sys.exit()

        if az_se == '1':
            az_api = AZlyrics('google')

        if az_se == '2':
            az_api = AZlyrics('duckduckgo')

        print('You can either get the song with the song title and artist '
              'name, or you can search via lyrics.')
        print()
        print('If you don\'t remember the name of the artist, you can '
              'search by title only.')
        print('If you want to search by lyrics, put the lyrics in the '
              'title field')
        artist_name = input('Type in the name of the artist: ')
        song_title = input('Type in the title of the song: ')

        az_api.artist = artist_name
Example #6
0
from azapi import AZlyrics

api = AZlyrics('google')

# We are Searching for Meghan's song "All about that bass"
api.title = 'about that bass'

Lyrics = api.getLyrics()

print(Lyrics)
Example #7
0
from azapi import AZlyrics

api = AZlyrics()

api.artist = 'Taylor Swift'
songs = api.getSongs()

for song in songs:
    api.getLyrics(url=songs[song]["url"])
Example #8
0
from azapi import AZlyrics

# Names should be passed corrrectly
# If you can't remember, use google or duckduckgo
# AZlyrics('google')
api = AZlyrics()

api.artist = 'Taylor Swift'
api.title = 'Blank Space'

api.getLyrics(save=True)
Example #9
0
from azapi import AZlyrics

api = AZlyrics('duckduckgo')

# Mis-typing "Meghan Trainor" and "All about the bass"
api.artist = 'Mehgan trenor'
api.title = 'about this bass'

# Using search to get correct artist and title
Lyrics = api.getLyrics()

print(Lyrics)
Example #10
0
from azapi import AZlyrics
import pprint

api = AZlyrics()

songs = api.getSongs('Ed Sheeran')

pprint.pprint(songs, indent=5)
Example #11
0
from azapi import AZlyrics

api = AZlyrics()

api.getLyrics(artist='kendrick lamar', title='humble')
Example #12
0
from azapi import AZlyrics

api = AZlyrics('google')

# Kanye is in the format of "West" in AZLyrics database
# Here we search for his name to fetch the correct url
api.artist = 'Kanye west'
songs = api.getSongs()

for song in songs:
    print(song, songs[song]['year'])
Example #13
0
from azapi import AZlyrics

api = AZlyrics('duckduckgo')

api.artist = 'Taylor Swift'
api.title = 'Blank Space'

api.getLyrics(path='C:\\Music\\Lyrics')
Example #14
0
    token = util.prompt_for_user_token(username, scope)

#spotify spotifyObject
spotifyObject = spotipy.Spotify(auth=token)
# print(json.dumps(VARIABLE, sort_keys=True, indent=4))
while True:
    track = spotifyObject.current_user_playing_track()
    artist = track['item']['artists'][0]['name']
    track = track['item']['name']

    #print(track)
    #print(artist)
    if artist != "":
        print("Currently playing " + artist + " - " + track + "\n")

#Seacrching  song on az Lyrics
    api = AZlyrics()
    #n = input("Enter song name:")
    #i = input("Enter artist name:")

    z = api.getLyrics(artist='%s' % artist, title='%s' % track)
    print(z)

    #print(type(z))
    """ext = 'txt'
    with open('{} - {}.{}'.format(track, artist, ext), 'r', encoding='utf-8') as l:
        l.seek(0)
        p = l.read()"""

    time.sleep(10)
Example #15
0
    audio = r.record(source)  # read the entire audio file
    
# recognize speech using Sphinx
try:
    print(r.recognize_sphinx(audio))
except sr.UnknownValueError:
    print("Sphinx could not understand audio")
except sr.RequestError as e:
    print("Sphinx error; {0}".format(e))



# Create MP3File instance.
mp3 = MP3File(src)

# Get all tags.

rawSong = mp3.song[0]

api = AZlyrics()

songstr = str(rawSong.value)


songs = api.search(songstr[0: len(songstr) - 1], category = 'songs')

# Song appears to be the first in search results
song_url = songs[0]['url']

Lyrics = api.getLyrics(url = song_url)
Example #16
0
from azapi import AZlyrics

api = AZlyrics()

# Using search to get correct artist and title
Lyrics = api.getLyrics(artist='meghan', title='bass', search=True)

print(Lyrics)
Example #17
0
from azapi import AZlyrics

api = AZlyrics('Taylor Swift')

songs = api.getSongs()

for song in songs:
    api.getLyrics(url=songs[song]["url"])
Example #18
0
from azapi import AZlyrics

api = AZlyrics()

# Kanye is in the format of "West" in AZLyrics database
# Here we search for his name to fetch the correct url
songs = api.getSongs('Kanye', True)

print(songs)
Example #19
0
from azapi import AZlyrics
import pprint

api = AZlyrics()

api.artist = 'Ed Sheeran'

songs = api.getSongs()

pprint.pprint(songs, indent=5)