Topic: Buggy API?

Posted under e621 Tools and Applications

Hey y'all,

  • typed_tags Set to true to return typed tag information. The tags value returned is a dictionary with each tag type as a key and then a list of tags of that type.

(From the API documentation)

I've tried to call this API call with &typed_tags=false and it gives me a dictionary of types containing lists of tags. I doubt this is intended, as typed_tags hasn't been set to true.
Even using &typed_tags= without anything displays the typed tags. Only removing the = (&typed_tags) shows the default tag list.

Could that be a bug in the API? Maybe a mod/admin knows more about it?
PS: Using e926 in example links because at work lol
PPS: I'm trying to write a Python3 API Wrapper, that's how I noticed this "bug" :P

Updated by KiraNoot

There are a bunch of oddities with the API. This specific value however simply checks if it is present in the params list and not empty, so you should OMIT typed_tags from the list of you don't want typed tags.

Updated by anonymous

KiraNoot said:
This specific value however simply checks if it is present in the params list and not empty

Well, that's not how checking for true works tho :/
It shouldn't just be "is it present?" whether or not it's false. Passing false should be considered by the API as a false value and therefore show the tags as a list and not as a dict of types with lists of tags.

But okay, at least I know how it works now and will try to adapt.

Updated by anonymous

Coming back to this thread as a new issue has arised for me:

https://e621.net/post/vote.json?id=1789239&score=1 "redirects" me to this atrocity (the Hex value 0x000000060177e0 changes every time) and displays "This post does not exist" on red background.

I pass a custom User-Agent (e621.py | Version 0.0.1 | by t.me/(my tg-handle)) and my login= and password_hash= but the request still fails.
Printing the response from the server I receive this error (requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https:// e621.net/post/vote.json*) even though I can't see where there is an issue.
*space to prevent hyperlink and have inline code working lol

I have given the API the exact values as per the documentation and it just doesn't work.

Updated by anonymous

POST method is required for any call that modifies state.

Updated by anonymous

  • 1