nociza / Bimg

A reverse-engineered Bing Image Creator API as an NPM package
The Unlicense
79 stars 11 forks source link

Stopped working 26th November 2023 #11

Open Brad3273 opened 9 months ago

Brad3273 commented 9 months ago

I was using this for the last two-odd weeks, since the 13th November 2023. It worked great! Thank you.

It suddenly stopped working in the morning of the 26th November 2023 GMT. 'Stopped working' as in it immediately returns with an error: $ node ./getbing.js "A bicycle" Prompt: A bicycle Sending request... https://www.bing.com/images/create?q=A%20bicycle&rt=3&FORM=GENCRE done with no errors! Promise { } Redirected to https://www.bing.com/images/create?q=A%20bicycle&rt=3&FORM=GENCRE Waiting for results... . { end: '', flush: true } imagesResponse.data: { errorMessage: 'Pending', showContent: '', enableDebug: false } file:///home/azureus2/node_modules/bimg/dist/imgen.js:81 throw new Error("This prompt has been blocked by Bing. Bing's system flagged this prompt because it may conflict with their content policy. More policy violations may lead to automatic suspension of your access."); ^

Error: This prompt has been blocked by Bing. Bing's system flagged this prompt because it may conflict with their content policy. More policy violations may lead to automatic suspension of your access. at getImages (file:///home/azureus2/node_modules/bimg/dist/imgen.js:81:15) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async generateImageFiles (file:///home/azureus2/node_modules/bimg/dist/imgen.js:157:24)

I put in a couple of lines of debug so the output and line numbers won't agree with the repository.

I can still submit prompts to Bing via my Chrome browser using the same IP address. I've double checked the cookie (which hasn't changed) in the .env file.

This was an excellent tool and was very useful. I don't know what Microsoft did, but it would appear something's now blocking what Bimg does.

Brad3273 commented 9 months ago

I don't know much about this sort of thing, but ... I grabbed all of the cookies from a Bing browser sesson (using the DevTools Network inspector) and just copied them in their entirety into dist/imgen.js instead of just '_U' and it's worked twice in a row for a simple prompt.

I'm wary about continuing to use it, though, as I don't know whether using ALL of the cookies will look super-suspicious; maybe some are supposed to change with each query?

Saitgalin commented 9 months ago

the same problem was solved by adding values to the cookie for BCP= and SRCHHPGUSR=

Brad3273 commented 9 months ago

My browser doesn't have a BCP cookie when using Bing Image Creator?

Saitgalin commented 9 months ago

maybe BCP needed only in my case, i changed the code a little. does it work with the addition of SRCHHPGUSR= in your case?

Brad3273 commented 9 months ago

does it work with the addition of SRCHHPGUSR= in your case?

Yes it does! Thanks. So, I've got just _U and SRCHHPGUSR cookies and it appears to be working again.

rizxyu commented 9 months ago

does this method still work?

Brad3273 commented 9 months ago

After a day or two it stopped working for me again, so I went back to copying all the cookies, and that has been working to date.

ERLANRAHMAT commented 8 months ago

does this method still work?

Brad3273 commented 8 months ago

Yes, it is still working for me. I'm copying the entire 'cookie' string from the browser's requests header for the /images/create?q=... query into dist/imgen.js before I run bimg.

ERLANRAHMAT commented 8 months ago

ok,thanks info i will try

ERLANRAHMAT commented 8 months ago

This method works, thank you very much 🙏🏻

Legends-of-NGDB commented 6 months ago

Does, this still work? I've tried your method and it did work for the first day but then Bing is blocking it and not redirecting...

Brad3273 commented 6 months ago

Bimg has been working brilliantly for me every day, as of 24 hours ago when I last used it. As per my last comment I copy the entire cookie header from my browser into imgen.js.

It's great and I'm very grateful to the author for providing the program!