summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-08 22:02:52 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-08 22:02:52 +0100
commitc1b992c3460cb0069127524a9b987a8af475ec14 (patch)
tree5a8797a0a4e887837a374e0097a62ecf8a9c91a5 /g4f/Provider/bing
parentFix key error in set_cookies (diff)
downloadgpt4free-c1b992c3460cb0069127524a9b987a8af475ec14.tar
gpt4free-c1b992c3460cb0069127524a9b987a8af475ec14.tar.gz
gpt4free-c1b992c3460cb0069127524a9b987a8af475ec14.tar.bz2
gpt4free-c1b992c3460cb0069127524a9b987a8af475ec14.tar.lz
gpt4free-c1b992c3460cb0069127524a9b987a8af475ec14.tar.xz
gpt4free-c1b992c3460cb0069127524a9b987a8af475ec14.tar.zst
gpt4free-c1b992c3460cb0069127524a9b987a8af475ec14.zip
Diffstat (limited to 'g4f/Provider/bing')
-rw-r--r--g4f/Provider/bing/create_images.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/Provider/bing/create_images.py b/g4f/Provider/bing/create_images.py
index e1031e61..b31e9408 100644
--- a/g4f/Provider/bing/create_images.py
+++ b/g4f/Provider/bing/create_images.py
@@ -23,7 +23,7 @@ from ..helper import get_cookies, get_connector
from ...webdriver import WebDriver, get_driver_cookies, get_browser
from ...base_provider import ProviderType
from ...image import ImageResponse
-from ...errors import MissingRequirementsError, MissingAccessToken
+from ...errors import MissingRequirementsError, MissingAuthError
BING_URL = "https://www.bing.com"
TIMEOUT_LOGIN = 1200
@@ -210,7 +210,7 @@ class CreateImagesBing:
try:
self.cookies = get_cookies_from_browser(self.proxy)
except MissingRequirementsError as e:
- raise MissingAccessToken(f'Missing "_U" cookie. {e}')
+ raise MissingAuthError(f'Missing "_U" cookie. {e}')
yield asyncio.run(self.create_async(prompt))
async def create_async(self, prompt: str) -> ImageResponse:
@@ -225,7 +225,7 @@ class CreateImagesBing:
"""
cookies = self.cookies or get_cookies(".bing.com", False)
if "_U" not in cookies:
- raise MissingAccessToken('Missing "_U" cookie')
+ raise MissingAuthError('Missing "_U" cookie')
proxy = os.environ.get("G4F_PROXY")
async with create_session(cookies, proxy) as session:
images = await create_images(session, prompt, self.proxy)