Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Danbooru CSFR problem #60

Open
Magos-Errant opened this issue Jan 10, 2022 · 2 comments
Open

Danbooru CSFR problem #60

Magos-Errant opened this issue Jan 10, 2022 · 2 comments

Comments

@Magos-Errant
Copy link

Magos-Errant commented Jan 10, 2022

Thank you for your work on the development of this very useful code! I have recently encountered an error (it was working fine before, I think that Danbooru changed something in their API)

When using two tags to access random picture:

danbo_client = Danbooru('danbooru')
picture = danbo_client.post_list(tags=_tags, limit=1, random=True)

The following error occurs:
In _request: 422 - Locked, The resource is locked and cannot be modified - URL

After checking what is happening with the link it provides, it actually contains the requested list with a JSON object. But when fetched with python results in the following error:

{
    "backtrace": [],
    "message": "Can't verify CSRF token authenticity.",
    "success": false
}

Expected Behavior

Return of list containing JSON object

Actual Behavior

Proper behavior for 1 tag and 1 tag with rating tag. Error when inputting more than one tag.

Steps to Reproduce

  1. Input more than 2 tags into post_list().

Context

The issue prevents from using more than one tag, excluding rating tag.

Environment

Pybooru Version: 4.2.2
Python Version: 3.8
Operating system: Windows 10
Link to your project: https://github.com/Magos-Errant/Shinsha

@LuqueDaniel
Copy link
Owner

Thank you very much. I will check it out.

@ShibePlanet
Copy link

Has any fix to this been found? It's still a very big issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants