Skip to content

Commit

Permalink
Merge pull request #70 from Rubiksman78/dev
Browse files Browse the repository at this point in the history
cai_fixed_again
  • Loading branch information
Rubiksman78 committed Aug 25, 2023
2 parents 39b15e3 + d80df15 commit d5e0f55
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,7 @@ def init_stt(model="base", english=True,energy=300, pause=0.8, dynamic_energy=Fa
def first_start(context):
page = context.new_page()
page.goto("https://character-ai.us.auth0.com/u/login?state=hKFo2SAxWUlJZGZBR1dSdXo1M2VfQm9qT21KeGJJV2oxcVAwR6Fur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEVwaVNsaGh3YU5MSzJiYXo5ZDg2c09GR05VaGQza3Zvo2NpZNkgZHlEM2dFMjgxTXFnSVNHN0Z1SVhZaEwyV0VrbnFaenY")
# page.wait_for_load_state("networkidle")
#queue_and_things(page)
sendMessage("not_in_queue".encode("utf-8"))
# page.wait_for_selector('[id="#AcceptButton"]',timeout=5000000)
# page.click('[id="#AcceptButton"]')
# page.get_by_text("Log in").click()
# page.fill('[id="username"]',USERNAME,timeout=500) ##put mail here
# page.fill('[id="password"]',PASSWORD,timeout=500) ##put password here
# page.click('[data-action-button-primary]')
# page.wait_for_load_state("networkidle")
# page.wait_for_selector('[href="/search?"]',timeout=5000)
page.wait_for_selector('[href="/search?"]',timeout=50000000)
context.storage_state(path="storage.json")
return page
Expand Down Expand Up @@ -263,6 +253,7 @@ def launch(context,pw,browser):
page.wait_for_timeout(500)
page.click('[class="col-auto px-2 dropdown"]',timeout=5000)
page.click('text=Save and Start New Chat',timeout=5000)
page.wait_for_load_state("networkidle")
return page

def post_message(page, message):
Expand Down Expand Up @@ -422,7 +413,7 @@ def listenToClient(client):
while True:
if not page.is_disabled('[class="btn py-0"]'):
time.sleep(3)
query = page.query_selector_all(('[class="markdown-wrapper markdown-wrapper-last-msg swiper-no-swiping"]'))
query = page.query_selector_all(('[class="swiper-no-swiping"]'))
if len(query) > 0:
msg = query[0].inner_html()
else:
Expand Down Expand Up @@ -561,4 +552,4 @@ def listenToClient(client):
ACCEPT_THREAD = Thread(target=listen)
ACCEPT_THREAD.start()
ACCEPT_THREAD.join()
SERVER.close()
SERVER.close()

0 comments on commit d5e0f55

Please sign in to comment.