from musicbrainz2 import webservice as ws ws Query ws ArtistFilter nam

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
>>> from musicbrainz2 import webservice as ws
>>> q = ws.Query()
>>> f = ws.ArtistFilter(name='Rammstein', limit=1)
>>> a = q.getArtists(f)[0].artist
>>> f = ws.TrackFilter(title='Adios', artistId=a.id)
>>> q.getTracks(f)
---------------------------------------------------------------------------
RequestError Traceback (most recent call last)
/home/piranha/<ipython console> in <module>()
/var/lib/python-support/python2.5/musicbrainz2/webservice.py in getTracks(self, filter)
872 @raise ResponseError: server returned invalid data
873 """
--> 874 result = self._getFromWebService('track', '', filter=filter)
875 return result.getTrackResults()
876
/var/lib/python-support/python2.5/musicbrainz2/webservice.py in _getFromWebService(self, entity, id_, include, filter)
916 includeParams = include.createIncludeTags()
917
--> 918 stream = self._ws.get(entity, id_, includeParams, filterParams)
919 try:
920 parser = MbXmlParser()
/var/lib/python-support/python2.5/musicbrainz2/webservice.py in get(self, entity, id_, include, filter, version)
260 self._log.debug("GET failed: " + str(e))
261 if e.code == 400: # in python 2.4: httplib.BAD_REQUEST
--> 262 raise RequestError(str(e), e)
263 elif e.code == 401: # httplib.UNAUTHORIZED
264 raise AuthenticationError(str(e), e)
RequestError: HTTP Error 400: Bad Request