1 (edited by markhoney 2012-07-08 13:09:26)

Topic: [solved] Error using tagger.xmlws.get

Hi,

I'm trying to use tagger.xmlws.get to grab an XML file from Last.FM, and I'm getting an error:

E: <sip.voidptr object at 0x03B72CE0> 12:17:39 Network request error for : Protocol "" is unknown (QT code 301, HTTP code 0)

I'm not sure what I'm doing wrong, but here's my code:

  fmhost = 'ws.audioscrobbler.com'
  fmport = 80
  from picard.webservice import REQUEST_DELAY
  REQUEST_DELAY[(fmhost, fmport)] = 200
  fmmethod = "2.0/?method="
  fmid = "&mbid=" + self.metadata['musicbrainz_albumartistid']
  fmapi = "&api_key=123456789012345678901234567890"
  fmpath = fmmethod + "artist.getTopTags" + fmid + fmapi
  self.album.tagger.xmlws.get(fmhost, fmport, fmpath, partial(self._getgenres))

Can anyone spot what I'm doing wrong?

Re: [solved] Error using tagger.xmlws.get

I figured it out, by first looking at the Picard code where I spotted a useful debug line:

https://github.com/musicbrainz/picard/b … service.py

def _start_request(self, method, host, port, path, data, handler, xml, mblogin=False):
        self.log.debug("%s http://%s:%d%s", method, host, port, path)

By turning on debug (picard --debug), I saw:

D: <sip.voidptr object at 0x03EB7338> 15:23:46 GET http://ws.audioscrobbler.com:802.0/?method=artist.getTopTags&mbid=01252145-c9e8-4de5-a480-9b2bed05450a&api_key=123456789012345678901234567890

D: <sip.voidptr object at 0x03EB7380> 15:23:46 Received reply for : HTTP 0 ()

E: <sip.voidptr object at 0x03EB7368> 15:23:46 Network request error for : Protocol "" is unknown (QT code 301, HTTP code 0)

I was missing a leading forward slash for my path, so ' http://ws.audioscrobbler.com:802.0/?method..." should have been " http://ws.audioscrobbler.com:80/2.0/?method...".

Re: [solved] Error using tagger.xmlws.get

It'd be easier to debug if you posted fuller plugin code, but most likely it is that the path should start with a '/':

fmmethod = "/2.0/?method="

Re: [solved] Error using tagger.xmlws.get

Ahh, doh - post overlap.