AtoraSuunva / booru

Searches boorus for images using some js magic
https://www.npmjs.com/package/booru
MIT License
75 stars 18 forks source link

Gelbooru limits anonymous usage now #90

Closed respektive closed 1 year ago

respektive commented 1 year ago

The limit seems to be pretty low. Anytime I try to search on gelbooru I get an error saying Search error: We have exceeded maximum queries per day for anonymous usage. Yukkuri Shiteitte ne! :<. This can be avoided by setting the api_key and uesr_id URL parameters, which i currently do in a bit of a hacky way, by editing the api search url. In the future the credentials param on the BooruClass should probably be used.

AtoraSuunva commented 1 year ago

I didn't implement credentials before because Boorus do it in a bunch of different ways and I couldn't come up with a "nice" way of doing it, but I'm also being hit with this issue so I've really gotta put aside my current project and fix booru

It might take a bit because I'm busy for the next few days but I'll see what I can do

AtoraSuunva commented 1 year ago

Added in booru@2.6.0

const booru = require('booru')
const gelbooru = booru.forSite('gb', { api_key: 'key', user_id: 'id' })
gelbooru.getSearchUrl()
// https://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&tags=&limit=100&pid=1&api_key=key&user_id=id

// or
booru.search('gb', [], {
  credentials: { api_key: 'key', user_id: 'id' },
})
// Uses the same search URL as above