8. subtitle module

This module contains higher level classes to query Musixmatch API and build simple dictionary-like objects representing a track subtitle.

>>> from musixmatch.subtitle import Subtitle
>>> import musixmatch.api
>>> 
>>> try:
...     subtitle = Subtitle(subtitle_id=292)
... except musixmatch.api.Error, e:
...     pass
class Subtitle(dictionary=None, **keywords)

Bases: musixmatch.base.Item

This class builds a dict object representing a subtitle of a track. It can get subtitle through the musixmatch.api.Method track.subtitle.get or from an already well-formed dict. Create a Track object based on a given keyword argument:

Parameters:
  • track_id – musiXmatch track ID
  • musicbrainz_id – Musicbrainz track ID
  • track_echonest_id – Echonest track ID
  • subtitle_data – an already well-formed dict of track data
Raises :

musixmatch.api.Error if musixmatch.api.StatusCode is not 200

Once information are collected, the following keys are available:

Parameters:
  • subtitle_body – the subtitle text
  • subtitle_id – the Musixmatch subtitle id
  • subtitle_language – the subtitle language

Previous topic

7. lyrics module

This Page