Beispiel #1
0
 def getTopTags(artist, album, autocorrect=1):
     result = query('album.gettoptags', {
         'artist': artist,
         'album': album,
         'autocorrect': autocorrect
     })
     return [Tag(t) for t in result.get('toptags', {}).get('tag', [])]
Beispiel #2
0
 def search(album, limit=50, page=1):
     return AlbumResults(
         query('album.search', {
             'album': album,
             'page': page,
             'limit': limit
         }).get('results', {}))
Beispiel #3
0
 def getBuyLinks(artist, album, autocorrect=1, country='united states'):
     result = query(
         'album.getbuylinks', {
             'artist': artist,
             'album': album,
             'autocorrect': autocorrect,
             'country': country
         })
     affiliations = []
     for k, v in result.get('affiliations', {}).items():
         affiliations.extend([Affiliation(a, k) for a in v])
     return affiliations
Beispiel #4
0
	def getBuyLinks(artist, album, autocorrect=1, country='united states'):
		result = query('album.getbuylinks', {'artist': artist, 'album':album, 'autocorrect':autocorrect, 'country':country})
		affiliations = []
		for k, v in result.get('affiliations', {}).items():
			affiliations.extend([Affiliation(a, k) for a in v])
		return affiliations
Beispiel #5
0
	def getTopTracks(artist, limit=50, page=1, autocorrect=1):
		result = query('artist.gettoptracks', {'artist': artist, 'limit': limit, 'page': page, 'autocorrect': autocorrect})
		return [Track(t) for t in result.get('toptracks', {}).get('track', [])]
Beispiel #6
0
	def getSimilar(artist, limit=50, autocorrect=1):
		result = query('artist.getsimilar', {'artist':artist, 'limit':limit, 'autocorrect':autocorrect})
		return [Artist(e) for e in result.get('similarartists', {}).get('artist', [])]
Beispiel #7
0
	def getEvents(artist, limit=50, page=1, autocorrect=1, festivalsonly=0):
		result = query('artist.getevents', {'artist':artist, 'autocorrect':1, 'limit':limit, 'page':page, 'festivalsonly':festivalsonly})
		return [Event(e) for e in result.get('events', {}).get('event', [])]
Beispiel #8
0
	def search(artist, limit=50, page=1):
		'''Search for artists by the provided name'''
		return ArtistResults(query('artist.search', {'artist': artist, 'page':page, 'limit': limit}).get('results', {}))
Beispiel #9
0
	def search(track, artist=None, page=1, limit=30):
		'''Search for tracks by the provided name'''
		params = {'track': track, 'page':page, 'limit': limit}
		if artist:
			params['artist'] = artist
		return TrackResults(query('track.search', params).get('results', {}))
Beispiel #10
0
 def getCorrection(artist):
     """Get the name correction for the provided artist"""
     result = query("artist.getcorrection", {"artist": artist})
     return [Artist(a.get("artist", {})) for a in result.get("corrections", {}).get("correction", [])]
Beispiel #11
0
 def search(artist, limit=50, page=1):
     """Search for artists by the provided name"""
     return ArtistResults(
         query("artist.search", {"artist": artist, "page": page, "limit": limit}).get("results", {})
     )
Beispiel #12
0
 def get(artist, autocorrect=1, lang="en"):
     result = query("artist.getinfo", {"artist": artist, "autocorrect": autocorrect, "lang": lang})
     return Artist(result.get("artist", {}))
Beispiel #13
0
 def top(limit=50, page=1):
     result = query("chart.gettopartists", {"limit": limit, "page": page})
     return [Artist(a) for a in result.get("artists", {}).get("artist", [])]
Beispiel #14
0
 def getTopTracks(artist, limit=50, page=1, autocorrect=1):
     result = query(
         "artist.gettoptracks", {"artist": artist, "limit": limit, "page": page, "autocorrect": autocorrect}
     )
     return [Track(t) for t in result.get("toptracks", {}).get("track", [])]
Beispiel #15
0
	def getTopTags(artist, album, autocorrect=1):
		result = query('album.gettoptags', {'artist':artist, 'album':album, 'autocorrect':autocorrect})
		return [Tag(t) for t in result.get('toptags', {}).get('tag', [])]
Beispiel #16
0
 def search(track, artist=None, page=1, limit=30):
     '''Search for tracks by the provided name'''
     params = {'track': track, 'page': page, 'limit': limit}
     if artist:
         params['artist'] = artist
     return TrackResults(query('track.search', params).get('results', {}))
Beispiel #17
0
 def getEvents(artist, limit=50, page=1, autocorrect=1, festivalsonly=0):
     result = query(
         "artist.getevents",
         {"artist": artist, "autocorrect": 1, "limit": limit, "page": page, "festivalsonly": festivalsonly},
     )
     return [Event(e) for e in result.get("events", {}).get("event", [])]
Beispiel #18
0
	def get(artist, autocorrect=1, lang='en'):
		result = query('artist.getinfo', {'artist':artist, 'autocorrect':autocorrect, 'lang':lang})
		return Artist(result.get('artist', {}))
Beispiel #19
0
 def getImages(artist, limit=50, page=1, autocorrect=1, order="popularity"):
     result = query(
         "artist.getimages",
         {"artist": artist, "limit": limit, "page": page, "autocorrect": autocorrect, "order": order},
     )
     return [Image(i) for i in result.get("images", {}).get("image", [])]
Beispiel #20
0
	def getCorrection(artist):
		'''Get the name correction for the provided artist'''
		result = query('artist.getcorrection', {'artist': artist})
		return [Artist(a.get('artist', {})) for a in result.get('corrections', {}).get('correction', [])]
Beispiel #21
0
 def getSimilar(artist, limit=50, autocorrect=1):
     result = query("artist.getsimilar", {"artist": artist, "limit": limit, "autocorrect": autocorrect})
     return [Artist(e) for e in result.get("similarartists", {}).get("artist", [])]
Beispiel #22
0
	def getImages(artist, limit=50, page=1, autocorrect=1, order='popularity'):
		result = query('artist.getimages', {'artist':artist, 'limit':limit, 'page':page, 'autocorrect':autocorrect, 'order':order})
		return [Image(i) for i in result.get('images', {}).get('image', [])]
Beispiel #23
0
 def getTopAlbums(artist, limit=50, page=1, autocorrect=1):
     result = query(
         "artist.gettopalbums", {"artist": artist, "limit": limit, "page": page, "autocorrect": autocorrect}
     )
     return [Album(a) for a in result.get("topalbums", {}).get("album", [])]
Beispiel #24
0
	def getTopAlbums(artist, limit=50, page=1, autocorrect=1):
		result = query('artist.gettopalbums', {'artist':artist, 'limit':limit, 'page':page, 'autocorrect':autocorrect})
		return [Album(a) for a in result.get('topalbums', {}).get('album', [])]
Beispiel #25
0
 def getTopTags(artist, autocorrect=1):
     result = query("artist.gettoptags", {"artist": artist, "autocorrect": autocorrect})
     return [Tag(t) for t in result.get("toptags", {}).get("tag", [])]
Beispiel #26
0
	def top(limit=50, page=1):
		result = query('chart.gettopartists', {'limit':limit, 'page':page})
		return [Artist(a) for a in result.get('artists', {}).get('artist', [])]
Beispiel #27
0
	def search(album, limit=50, page=1):
		return AlbumResults(query('album.search', {'album':album, 'page':page, 'limit': limit}).get('results', {}))