Notice: My personal stance on AI generated artwork. Retweet and share if you agree. Let us discuss, and not immediately scream bloody murder.

Now Viewing: Error 403?
Keep it civil, do not flame or bait other users. If you notice anything illegal or inappropriate being discussed, contact an administrator or moderator.

Jerl - Group: The Real Administrator - Total Posts: 6706
user_avatar
Posted on: 11/16/15 07:58PM

There is no login API. You must log in to the site the same way as normal.

You don't, however, need to give your user a web view. You can simply have your program collect the username and password itself and send those in the request.

Your request should be a POST sent to this address:
gelbooru.com/index.php?page=account&s=login&code=00

The POST string should look like this:
user={0}&pass={1}&submit=Log+in

with {0} replaced by the username and {1} replaced by the password. Then you get the cookies from the response.

Yes, it is the user ID cookie instead of username. My apologies.



Friederich - Group: Member - Total Posts: 13
user_avatar
Posted on: 11/16/15 09:14PM

Jerl said:
There is no login API. You must log in to the site the same way as normal.

You don't, however, need to give your user a web view. You can simply have your program collect the username and password itself and send those in the request.

Your request should be a POST sent to this address:
gelbooru.com/index.php?page=account&s=login&code=00

The POST string should look like this:
user={0}&pass={1}&submit=Log+in

with {0} replaced by the username and {1} replaced by the password. Then you get the cookies from the response.

Yes, it is the user ID cookie instead of username. My apologies.


It looks like that is working. I will test it with my program and see how it goes. Based on Postman's results it looks fine.

Thanks a lot for your help.



Friederich - Group: Member - Total Posts: 13
user_avatar
Posted on: 11/27/15 09:51PM

My app seems to be able to fetch Gelbooru posts just fine now!

Thanks a lot for your help Jerl. Much appreciated.



Jerl - Group: The Real Administrator - Total Posts: 6706
user_avatar
Posted on: 11/27/15 10:55PM

No problem.



Elaanel - Group: Member - Total Posts: 49
user_avatar
Posted on: 12/01/15 11:31AM

Is it just about sending the request and getting a cookie, then use it in the app ?

If it's that, what I'll have to do will multiply the requests. I can't make cookies, so I'll have to send a login request before each search, and each preview picture download. Won't that be too heavy for such simple things ?

Because for now, my app does that :
Querying "gelbooru.com/index.php?pa...s=login&code=00" with POST "user={USERID}&pass={UNHASHED_PASS}&submit=Log+in"

Unless you need the hashed password

Edit : It doesn't work with the hashed pass either



Friederich - Group: Member - Total Posts: 13
user_avatar
Posted on: 12/01/15 11:54AM

Elaanel said:
Is it just about sending the request and getting a cookie, then use it in the app ?

If it's that, what I'll have to do will multiply the requests. I can't make cookies, so I'll have to send a login request before each search, and each preview picture download. Won't that be too heavy for such simple things ?

Because for now, my app does that :
Querying "gelbooru.com/index.php?pa...s=login&code=00" with POST "user={USERID}&pass={UNHASHED_PASS}&submit=Log+in"

Unless you need the hashed password

Edit : It doesn't work with the hashed pass either


What language and framework are you working with?

I believe the preview download requires a Gelbooru referer, not a cookie, but someone correct me if I'm wrong.



Jerl - Group: The Real Administrator - Total Posts: 6706
user_avatar
Posted on: 12/01/15 11:54AM

Cookies are plaintext. You can store the cookie in working memory as a string.

It's actually 2 cookies, though. You also need user_id in addition to pass_hash. Sending the username in your request anywhere but the login page will not work.

Friederich said:

I believe the preview download requires a Gelbooru referer, not a cookie, but someone correct me if I'm wrong.


Correct. You do not need cookies to load images at all, just a Gelbooru referrer.



Elaanel - Group: Member - Total Posts: 49
user_avatar
Posted on: 12/01/15 01:17PM

Well, querying the link i specifieds with user + pass doesn't give me any cookie back, that's the problem.

Edit : I finally got it. Raw password + username. I don't know why it didn't worked before



Friederich - Group: Member - Total Posts: 13
user_avatar
Posted on: 12/07/15 10:07PM

Where there any changes done lately? I can use everything fine but I am having troubles downloading full images. Seems to be rather recent, too.



Jerl - Group: The Real Administrator - Total Posts: 6706
user_avatar
Posted on: 12/07/15 10:31PM

I have not been informed of any changes. On the other hand, that's not really a new thing.

I remember that for a while, when I tried to download full images, I'd get a blank file. I think it was just a temporary bug, since it stopped happening. Try again in a day or so to see if it's still happening.



add_replyAdd Reply


«1234567 8 9