poe-api
poe-api copied to clipboard
Login using email and password credentials instead of cookie token
Hi, is it possible to login using email and password credentials instead of cookie token? I have two poe accounts, and when I log into another, the other cookie token will become invalid. In order to allow to use api, does that mean I should never delete the cookies after using it?
Hello @jamezun. I don't know if it can help you, but a few days ago, I created a script that allowed to automate the whole connection system (with a randomly generated email address). I think you can easily modify it or use it as inspiration to use your own email address. However, the code is not really optimized. Moreover I think that we could perhaps simplify it by passing via calls to the API.
Here is the script:
from TempMail import TempMail
import poe, time, re
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
inbox = TempMail.generateInbox()
options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(options = options)
driver.get("https://poe.com/login")
assert "Poe" in driver.title
driver.find_element(By.CLASS_NAME, "MainSignupLoginSection_switchLoginMethodButton__B8mtS").click()
print("Email:", inbox.address)
email_input = driver.find_element(By.CLASS_NAME, "EmailInput_emailInput__4v_bn")
email_input.send_keys(inbox.address)
email_input.send_keys(Keys.RETURN)
code = None
while not code:
print("Waiting for verification code...")
for mail in TempMail.getEmails(inbox):
if mail.subject != "Your verification code":
continue
code = ''.join([char for char in re.sub(re.compile("<style[^>]*>[^<]*<\/style>|<[^>]*>"), "", mail.html) if char.isdigit()])[2:8]
time.sleep(30)
print("Verification code:", code)
code_input = driver.find_element(By.CLASS_NAME, "VerificationCodeInput_verificationCodeInput__YD3KV")
code_input.send_keys(code)
code_input.send_keys(Keys.RETURN)
token = driver.get_cookie("p-b")["value"]
print("Token:", token)
client = poe.Client(token)
print("Bots available: ", client.get_bot_names())
time.sleep(5)
driver.close()
Check this library that I have made : https://github.com/krishna2206/poe-auth
I could add OTP authentication into the library, but I'd leave actually reading the received emails up to the user. This'll probably make it into a future 0.3.x release.
Hello @jamezun. I don't know if it can help you, but a few days ago, I created a script that allowed to automate the whole connection system (with a randomly generated email address). I think you can easily modify it or use it as inspiration to use your own email address. However, the code is not really optimized. Moreover I think that we could perhaps simplify it by passing via calls to the API.
Here is the script:
from TempMail import TempMail import poe, time, re from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By inbox = TempMail.generateInbox() options = webdriver.ChromeOptions() options.add_argument("--headless") options.add_experimental_option('excludeSwitches', ['enable-logging']) driver = webdriver.Chrome(options = options) driver.get("https://poe.com/login") assert "Poe" in driver.title driver.find_element(By.CLASS_NAME, "MainSignupLoginSection_switchLoginMethodButton__B8mtS").click() print("Email:", inbox.address) email_input = driver.find_element(By.CLASS_NAME, "EmailInput_emailInput__4v_bn") email_input.send_keys(inbox.address) email_input.send_keys(Keys.RETURN) code = None while not code: print("Waiting for verification code...") for mail in TempMail.getEmails(inbox): if mail.subject != "Your verification code": continue code = ''.join([char for char in re.sub(re.compile("<style[^>]*>[^<]*<\/style>|<[^>]*>"), "", mail.html) if char.isdigit()])[2:8] time.sleep(30) print("Verification code:", code) code_input = driver.find_element(By.CLASS_NAME, "VerificationCodeInput_verificationCodeInput__YD3KV") code_input.send_keys(code) code_input.send_keys(Keys.RETURN) token = driver.get_cookie("p-b")["value"] print("Token:", token) client = poe.Client(token) print("Bots available: ", client.get_bot_names()) time.sleep(5) driver.close()
lol they banned the domains from tempmail-lol :rofl: are the devs for real :rofl: they left a 30-minute window where I could still use options.add_argument('--disable-blink-features=AutomationControlled')
and then they legit banned all the cookies created from these temp mails :rofl: holy shit
Use email on deck it works till now
Use email on deck it works till now
can you explain more please ?
Use email on deck it works till now
can you explain more please ?
You can use email on deck temporary mail. It worked on my first try after getting baneed on another temporary mail
hi, why is it always stuck in the registration page when I enter my email to register poe?