Skip to content
This repository was archived by the owner on Aug 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ options:
-h, --help show this help message and exit
-U U Auth cookie from browser
--prompt PROMPT Prompt to generate images for
--asyncio Use async to sync png
--output-dir OUTPUT_DIR
Output directory
```
Expand Down
3 changes: 2 additions & 1 deletion src/BingImageCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def __init__(self, auth_cookie: str, quiet: bool = False) -> None:
self.session = aiohttp.ClientSession(
headers=HEADERS,
cookies={"_U": auth_cookie},
trust_env=True,
)
self.quiet = quiet

Expand Down Expand Up @@ -201,7 +202,7 @@ async def get_images(self, prompt: str) -> list:
if response.status != 200:
raise Exception("Could not get results")
content = await response.text()
if content:
if content and content.find("errorMessage") == -1:
break

await asyncio.sleep(1)
Expand Down