EdgeGPT
EdgeGPT copied to clipboard
Exception: Redirect failed
import json
from ImageGen import ImageGen
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-U", help="Auth cookie from browser", type=str)
parser.add_argument("--cookie-file", help="File containing auth cookie", type=str)
parser.add_argument(
"--prompt",
help="Prompt to generate images for",
type=str,
required=True,
)
parser.add_argument(
"--output-dir",
help="Output directory",
type=str,
default="./output",
)
args = parser.parse_args()
# Load auth cookie
with open(args.cookie_file, encoding="utf-8") as file:
cookie_json = json.load(file)
for cookie in cookie_json:
if cookie.get("name") == "_U":
args.U = cookie.get("value")
break
if args.U is None:
raise Exception("Could not find auth cookie")
# Create image generator
image_generator = ImageGen(args.U)
image_generator.save_images(
image_generator.get_images("Ukraine"),
output_dir=args.output_dir,
)
I use python 1.py --cookie-file C:\Users\Genife\PycharmProjects\chatgpt\cookies.json --prompt Random
Status code: 200 (not 302)
Latest ver from github
If you try my fork do you still get the same issue? https://github.com/JAB-dev/EdgeGPT
Ye, it fixes