Skip to content

Commit

Permalink
feat: make cookies non-required
Browse files Browse the repository at this point in the history
  • Loading branch information
F33RNI committed May 14, 2024
1 parent a5bd47b commit 5e7a837
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lmao/chatgpt/chatgpt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ def session_start(self, **kwargs) -> None:
logging.info(f"Loading cookies from {cookies_file}")
with open(cookies_file, "r", encoding="utf-8") as file:
self._cookies = json.load(file)
if self._cookies is None or not isinstance(self._cookies, list) or len(self._cookies) == 0:
raise Exception("Empty or wrong cookies file")
if self._cookies is None or not isinstance(self._cookies, list):
raise Exception("Wrong cookies file")
logging.info(f"Loaded {len(self._cookies)} cookies")

# Set driver options
Expand Down
4 changes: 2 additions & 2 deletions src/lmao/ms_copilot/ms_copilot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ def session_start(self, **kwargs) -> None:
logging.info(f"Loading cookies from {cookies_file}")
with open(cookies_file, "r", encoding="utf-8") as file:
self._cookies = json.load(file)
if self._cookies is None or not isinstance(self._cookies, list) or len(self._cookies) == 0:
raise Exception("Empty or wrong cookies file")
if self._cookies is None or not isinstance(self._cookies, list):
raise Exception("Wrong cookies file")
logging.info(f"Loaded {len(self._cookies)} cookies")

# Set driver options
Expand Down

0 comments on commit 5e7a837

Please sign in to comment.