Ran into a problem with the API

Posted under General

Hello! I've been trying to use python along with urllib2 and xml.dom.minidom to retrieve tags from images using Danbooru's pretty cool API.
However, every time a post contains the "|_|" tag, it ends up returning no tags at all. I checked the requested XML page manually and the tags seemed to be there, so I'm guessing the issue's not with the API. Everything else seems to work fine for me. What could be causing this?

Thanks in advance.

Updated by lvk

lvk said:
Ran into a problem with the API

lvk said:
I'm guessing the issue's not with the API.

...?

Have you double-checked that the XML file urllib2 is downloading is correct, and that xml.dom.minidom is parsing it properly? Because, uh, those are the only two points of failure left, by your own analysis.

glasnost said:
...?

I guess I should've gone for 'ran into a problem whilst using the API' instead. I'm sorry, I'm a bit tired.

I found the problem and it was me being stupid. I ended all lines with a pipe symbol so I could 'easily' seperate the post numbers from the md5 hash and the tags (splitting on newlines sometimes doesn't work for me, for some reason, so I thought I'd be safe). Problem was that it started searching for the pipe symbol starting from the left, not the right, leaving me with an empty line in the conversion process. The tag lists were fine. By changing a find to rfind, it's pretty much fixed.
Sorry to bother/make a topic for this.

1