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

Commit

Permalink
Maybe V1 works with plus account
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cheong committed Mar 9, 2023
1 parent e6b7794 commit 64f5f3d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/revChatGPT/V1.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def wrapper(*args, **kwargs):
return decorator


BASE_URL = environ.get("CHATGPT_BASE_URL") or "https://chat.duti.tech/api/"
BASE_URL = environ.get("CHATGPT_BASE_URL") or "https://chat.openai.com/backend-api/"


class ErrorType:
Expand Down Expand Up @@ -159,6 +159,7 @@ class Chatbot:
def __init__(
self,
config: dict[str, str],
puid: str,
conversation_id: str | None = None,
parent_id: str | None = None,
session_client=None,
Expand Down Expand Up @@ -197,6 +198,7 @@ def __init__(

self.config = config
self.session = session_client() if session_client else requests.Session()
self.session.cookies.set("_puid", puid)
try:
cached_access_token = self.__get_cached_access_token(
self.config.get("email", None),
Expand Down Expand Up @@ -958,11 +960,20 @@ def main(config: dict) -> NoReturn:
"""
Main function for the chatGPT program.
"""
print("Logging in...")
import argparse

parser = argparse.ArgumentParser()
parser.add_argument(
"--puid",
help="Plus User Token",
required=True,
)
args = parser.parse_args()
chatbot = Chatbot(
config,
conversation_id=config.get("conversation_id"),
parent_id=config.get("parent_id"),
puid=args.puid,
)

def handle_commands(command: str) -> bool:
Expand Down

0 comments on commit 64f5f3d

Please sign in to comment.