Waenara / bing-create

4 stars 2 forks source link

no more working #3

Open spupuz opened 1 month ago

spupuz commented 1 month ago

i got your library working in a mine python script then after a couple of day is no more working and i get this in logs

image_creator    | 2024-08-14 09:29:01,702 - httpx - INFO - HTTP Request: POST https://www.bing.com/images/create?q=47%20year%20old%20male%20with%20surf%20rayban%20black%20matte%20and%20orange%20mirror%20lenses%20with%20short%20Full%20goatee%20with%20small%20mustache,%20short%20brown%20hair%20with%20pepper%20grey%20on%20side,%20full%20body%20view%20in%20the%20picture,%20image%20must%20be%20GTA%20V%20style%20(cartoon%20comic).%20%20%22A%20serene%20couple%20stands%20together,%20bathed%20in%20warm%20sunlight,%20hands%20entwined,%20lost%20in%20each%20other's%20gaze,%20surrounded%20by%20a%20world%20that%20fades%20into%20the%20background,%20as%20their%20love%20becomes%20the%20eternal%20melody%20that%20fills%20their%20souls,%20a%20symphony%20of%20devotion%20and%20gratitude.%22&rt=3&FORM=GENCRE "HTTP/1.1 200 OK"
image_creator    | 2024-08-14 09:29:01,702 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']>
image_creator    | 2024-08-14 09:29:01,706 - httpcore.http11 - DEBUG - receive_response_body.complete
image_creator    | 2024-08-14 09:29:01,707 - httpcore.http11 - DEBUG - response_closed.started
image_creator    | 2024-08-14 09:29:01,707 - httpcore.http11 - DEBUG - response_closed.complete
image_creator    | 2024-08-14 09:29:01,707 - __main__ - WARNING - Attempt 2 failed: 🛑 Request to https://bing.com/ failed! (Redirect)

let me know if you need more info, is there a way to ckeck in detail where the problem could be?

Waenara commented 1 month ago

Thanks for reporting this! Please try upgrading or reinstalling the package, the issue may be fixed now. Let me know if it persists.

spupuz commented 1 month ago

Thanks for reporting this! Please try upgrading or reinstalling the package, the issue may be fixed now. Let me know if it persists.

i use docker so when regenerating the image i use:

COPY requirements.txt requirements.txt RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt --upgrade

so should be upgrade, but in github i see only setup.py updated not main.py

i got still error is it working for you?

image_creator | 2024-08-14 11:31:04,318 - httpx - INFO - HTTP Request: POST https://www.bing.com/images/create?q=47%20year%20old%20male%20with%20surf%20rayban%20black%20matte%20and%20orange%20mirror%20lenses%20with%20short%20Full%20goatee%20with%20small%20mustache,%20short%20brown%20hair%20with%20pepper%20grey%20on%20side,%20full%20body%20view%20in%20the%20picture,%20image%20must%20be%20GTA%20V%20style%20(cartoon%20comic).%20%20A%20dark,%20mysterious%20man%20with%20a%20sinister%20power%20to%20swiftly%20capture%20and%20kill%20flies%20with%20a%20deadly%20gesture,%20his%20eyes%20cold%20and%20menacing,%20surrounded%20by%20a%20dark,%20ominous%20atmosphere,%20with%20a%20hint%20of%20a%20special,%20melodious%20fly%20that%20catches%20his%20attention.&rt=3&FORM=GENCRE "HTTP/1.1 200 OK" image_creator | 2024-08-14 11:31:04,318 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'POST']> image_creator | 2024-08-14 11:31:04,319 - httpcore.http11 - DEBUG - receive_response_body.complete image_creator | 2024-08-14 11:31:04,319 - httpcore.http11 - DEBUG - response_closed.started image_creator | 2024-08-14 11:31:04,319 - httpcore.http11 - DEBUG - response_closed.complete image_creator | 2024-08-14 11:31:04,319 - main - WARNING - Attempt 3 failed: 🛑 Request to https://bing.com/ failed! (Redirect) image_creator | 2024-08-14 11:31:09,072 - main - ERROR - All attempts to generate images failed image_creator | 2024-08-14 11:31:09,073 - main - ERROR - Failed to generate images: All attempts to generate images failed image_creator | 2024-08-14 11:31:09,073 - werkzeug - INFO - 192.168.112.1 - - [14/Aug/2024 11:31:09] "POST / HTTP/1.1" 200 -

spupuz commented 1 month ago

@Waenara could be this something related to cookies? how long should it be valid?

Waenara commented 1 month ago

Maybe, try refreshing them

spupuz commented 1 month ago

Maybe, try refreshing them

i tried but still got problem does it work for you?

Waenara commented 1 month ago

Yes, it works perfectly for me. I'm not sure why you're having this issue. I'm currently busy with another project, so I'll look into this issue in the near future.

spupuz commented 1 month ago

i use it inside a docker app so should be reinstalled

Yes, it works perfectly for me. I'm not sure why you're having this issue. I'm currently busy with another project, so I'll look into this issue in the near future.

i tried altro from another pc with commnad: python bing-create --u 'my _U' --s 'my SRCHHPGUSR' --prompt pippo

Traceback (most recent call last):
  File "/test/env/bin/bing-create", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/test/env/lib/python3.12/site-packages/bing_create/main.py", line 292, in main
    generated_images = generator.generate(args.prompt, args.number)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/test/env/lib/python3.12/site-packages/bing_create/main.py", line 62, in generate
    raise Exception("🛑 Request to https://bing.com/ failed! (Redirect)")
spupuz commented 1 month ago

tried also with another SRCHHPGUSR and _U from another user but nothing to do.

@jdragonx is it working for you?

jdragonx commented 1 month ago

This happened to me a couple of times. Bing blocks the IP for 24 hours after around 100 requests. If you wait it should work again. You can also try changing your IP if you can do that. Tor network doesn't work as most IPs there are blocked already for numerous reasons. So you need an actual clean VPN.

Your account also gets blocked at 100 requests per day, and will work again after 24 hours. If you need more than 100 requests per day you will need multiple IPs and multiple accounts.

spupuz commented 1 month ago

Ok then thanks for the info I'll wait was becoming mad. I don't need so many request per day but I could have passed it with twsting, anyway from browser seems to work

spupuz commented 1 month ago

Ok confirm that now it's working again, @Waenara maybe as output of 302 response put.

Possible rate limit reached