Open joernroeder opened 8 years ago
I've got the following error on the LastFM API: Errors in file xml-schema: The prefix "opensearch" for element "opensearch:Query" is not bound. https://ws.audioscrobbler.com/2.0/?method=album.search&album=Foobar&api_key=a42ead6d2dcc2938bec2cda08a03b519 _The link is equal to LASTFM_URL_
Errors in file xml-schema: The prefix "opensearch" for element "opensearch:Query" is not bound.
After looking at the source i've removed the outer xml elements (including the namespaced <query> element) which aren't used by the parser.
<query>
# /cover_grabber/downloader/lastfm_downloader.py#L44 response = urllib.urlopen(self.url).read() # Send HTTP request to LastFM # removing invalid formatted wrapper xml. start_index = response.index("<albummatches>") end_index = response.index("</albummatches>") + len("</albummatches>") response = response[start_index:end_index] xml_data = ETree.fromstring(response) # Read in XML data
Now the stripped response is passed to the xml parser and everything works again. I could submit a pull request – Just let me know.
:ghost:
I've got the following error on the LastFM API:
Errors in file xml-schema: The prefix "opensearch" for element "opensearch:Query" is not bound.
https://ws.audioscrobbler.com/2.0/?method=album.search&album=Foobar&api_key=a42ead6d2dcc2938bec2cda08a03b519 _The link is equal to LASTFM_URL_After looking at the source i've removed the outer xml elements (including the namespaced
<query>
element) which aren't used by the parser.Now the stripped response is passed to the xml parser and everything works again. I could submit a pull request – Just let me know.
:ghost: