Package metalparser

Module metalparser.darklyrics

class metalparser.darklyrics.DarkLyricsApi(use_cache=True, debug_mode=False)[source]

Bases: object

A class with APIs for scraping DarkLyrics.com website.

Parameters
  • use_cache (bool) – Boolean defining if a cached session will be created or not.

  • debug_mode (bool) – Boolean defining when to save debug info on a log file.

helper

Object containing helpers for DarkLyrics.com APIs.

Type

DarkLyricsHelper

get_artists_list(self, initial_letter=None)[source]

Returns a list with all the artists registered on DarkLyrics.com. When specified, it returns a list of artists starting with an initial.

get_albums_info(self, artist, title_only=False)[source]

Returns a list containing all the albums titles related to an artist.

get_songs_info(self, artist, album=None, title_only=False)[source]

Returns a list containing the songs titles (and other info when specified) related to a single artist or album (when specified).

get_album_info_and_lyrics(self, album, artist)[source]

Returns a list of dict containing name, title, album, track number and lyrics of all the songs related to an album on DarkLyrics.com.

get_albums_info_and_lyrics_by_artist(self, artist)[source]

Returns a list of dict containing name, title, album, track number and lyrics of all the songs related to an artist on DarkLyrics.com.

def get_song_info_and_lyrics(self, song, artist)

Returns a str containing the lyrics of the specified song.

get_album_info_and_lyrics(album, artist, lyrics_only=False)[source]

Returns a list of dict containing info and lyrics of all the songs related to an album on DarkLyrics.com.

Parameters
  • {str} -- The title of the album (album) –

  • {str} -- The artist's name (artist) –

Returns

[list] – A list of dict containing info and lyrics about of all the songs related to the specified album or

a list of str containing only the lyrics of the specified album, depending on the lyrics_only flag.

get_albums_info(artist, title_only=False)[source]

Returns a list containing all the albums titles related to an artist.

Parameters

{str} -- The artist's name (artist) –

Returns

[list] – A list of str containing all the albums titles related to an artist

get_albums_info_and_lyrics_by_artist(artist)[source]

Returns a list of dict containing name, title, album, track number and lyrics of all the songs related to an artist on DarkLyrics.com.

Parameters

{str} -- The artist's name (artist) –

Returns

[list] – A list of dict containing info and lyrics of all the songs related to the specified artist.

get_artists_list(initial_letter=None)[source]

Returns a list with all the artists registered on DarkLyrics.com. When specified, it returns a list of artists starting with an initial.

Keyword Arguments

{str} -- The initial letter of The artist's name (initial_letter) – {None})

Raises

ValueError – Exception raised when the argument initial_letter is longer than 1 (when specified)

Returns

[list] – An alphabetically ordered list of str containing all the artists found according to the arguments

get_song_info_and_lyrics(song, artist, lyrics_only=False)[source]

Returns a str containing the lyrics of the specified song.

Parameters
  • {str} -- The title of the song (song) –

  • {str} -- The artist's name (artist) –

Returns

[dict or str] – A dict containing info and lyrics about a song of a certain artist or

a str containing only the lyrics of the specified song, depending on the lyrics_only flag.

get_songs_info(artist, album=None, title_only=False)[source]

Returns a list containing the songs titles related to a single artist or album (when specified).

Parameters

{str} -- The artist's name (artist) –

Keyword Arguments
  • {bool} -- (songs_only) –

  • {str} -- The album name (album) – {None})

Returns

[list] – A list of str containing the songs titles related to a single artist or album (when specified)