Malisius / booru2prompt

An extension for stable-diffusion-webui to convert image booru posts into prompts
58 stars 8 forks source link

AIBooru Fix #12

Closed lebenoa closed 9 months ago

lebenoa commented 1 year ago

AIBooru fix by adding default header

Somehow if the user-agent is blank (urllib supply only Connection: Close afaik), AIBooru will return 403: FORBIDDEN so this PR added your user-agent header to the default headers when making requests

'booru2prompt, a Stable Diffusion project (made by Borderless)'

Testing on my PC and it work like a charm

https://user-images.githubusercontent.com/76484203/217029192-a42bebfc-9254-4c39-919b-89e003f7f69c.mp4

P.S. Sorry for my English. I am not a native speaker of English.

KuroNeko87 commented 1 year ago

I confirm this edit works. Too bad it doesn't work for lolibooru :p

lebenoa commented 1 year ago

I confirm this edit works. Too bad it doesn't work for lolibooru :p

I looked into it a lil bit. It seems that lolibooru you're talking about doesn't expose neither .xml nor .json API (of the post itself) as I have read the API documentation and tried multiple combination of path.

The only way to get it working might be web scraping for now. but I don't have a plan to do it