George-iam / Midjourney_api

unofficial Midjourney API
MIT License
420 stars 76 forks source link

Is this the only way to get the discord token? #8

Open AIchovy opened 1 year ago

AIchovy commented 1 year ago

I have two questions:

  1. Is this the only way to get the user token by Chrome developer tools?
  2. Does this token have an expired time?
xucian commented 1 year ago

same question

NDNnerd commented 1 year ago

Arguably, no. Not sure it's more convenient. It can be automated though.

from playwright.sync_api import sync_playwright

def print_request(route, request):
    print(f"{request.method} {request.url}")
    route.continue_()

with sync_playwright() as playwright:
    browser = playwright.chromium.launch(headless=False)
    context = browser.new_context()

    context.route('**/*', print_request) # This enables request interception

    page = context.new_page()
    page.goto("https://discord.com/login")
    browser.close()