Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Exception: Redirect failed #7

Closed
hrizal opened this issue Mar 28, 2023 · 7 comments
Closed

Exception: Redirect failed #7

hrizal opened this issue Mar 28, 2023 · 7 comments

Comments

@hrizal
Copy link

hrizal commented Mar 28, 2023

i got this

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/dev/.local/lib/python3.10/site-packages/BingImageCreator.py", line 137, in <module>
    image_generator.get_images(args.prompt),
  File "/home/dev/.local/lib/python3.10/site-packages/BingImageCreator.py", line 47, in get_images
    raise Exception("Redirect failed")
@LuckyHead11
Copy link

What is your prompt?

@ktseo41
Copy link

ktseo41 commented Mar 29, 2023

same as here my prompt is

python3 -m BingImageCreator -U [myauthcookie] --prompt "cute dog" --output-dir ~/bing-image-creator

I replace the double quote with a single quote and it works. --->

python3 -m BingImageCreator -U [myauthcookie] --prompt 'cute dog' --output-dir ~/bing-image-creator

@hrizal
Copy link
Author

hrizal commented Mar 29, 2023

prompt is "swimming elephant"

i try change wiit single quote, still not work
still got raise Exception("Redirect failed")

@fredi-python
Copy link
Contributor

I once got this error too.
But since the newest version, i never got it again

@fredi-python
Copy link
Contributor

OK, i recognised If you try as example the prompt "elon musk", what isn't allowed by openai, you also get a redirect failed error.
But i didn't got one by using the "swimming elephant" prompt.

@LuckyHead11
Copy link

Yeah, It seems that when you make an "inappropriate" or a prompt that doesn't follow the content policy that's when it returns that.

@hrizal
Copy link
Author

hrizal commented Mar 31, 2023

solve,
I've never opened this page before
https://www.bing.com/images/
after opening it with a browser, and again calling this script with the same cookie, it finally worked

oh ya, requests are only served in English

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

No branches or pull requests

4 participants