Skip to content

Commit

Permalink
Dev 3.2.4 (#13)
Browse files Browse the repository at this point in the history
- new theme!
- code improvements

updated:
- dankware, all packages
- updated to python 3.11.8
  • Loading branch information
SirDank authored Feb 18, 2024
1 parent bbdc9b8 commit 5266f05
Show file tree
Hide file tree
Showing 16 changed files with 188 additions and 164 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

## ♦️ Preview ♦️

<br><p align="center"><img width="800" alt="image" src="https://github.com/SirDank/dank.tool/assets/52797753/ded02b28-8e3a-4a0b-aae0-1d09ba72e8e0"></p><br>
<br><p align="center"><img width="800" alt="image" src="https://github.com/SirDank/dank.tool/assets/52797753/99caab6e-68ee-4d8e-91f1-b85b6df7220e"></p><br>

## ♦️ Notes ♦️

Expand Down Expand Up @@ -339,6 +339,10 @@

<br><p align="center"><img width="550" alt="image" src="https://user-images.githubusercontent.com/52797753/235306892-5472e34a-1f2e-4dd5-adcc-2124def1e8bb.png"></p><br>

## ♦️ 3.1 ♦️

<br><p align="center"><img width="550" alt="image" src="https://github.com/SirDank/dank.tool/assets/52797753/ded02b28-8e3a-4a0b-aae0-1d09ba72e8e0"></p><br>

<p>&nbsp;</p>

---
Expand Down
11 changes: 5 additions & 6 deletions __modules__/dank.acropolis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
import requests
from translatepy import Translator
from dankware import title, cls, clr, align, rm_line
from dankware import white, white_normal, red, red_normal, red_dim, reset
from dankware import white_normal, white_bright, red, red_normal, red_dim

def translate(text):

if DANK_TOOL_LANG:
try: text = translator.translate(text, source_language='en', destination_language=DANK_TOOL_LANG).result
except: pass
return text

def print_read_me():
read_me = '\n\n::::::::: :::::::::: ::: ::::::::: :::: :::: ::::::::::\n:+: :+: :+: :+: :+: :+: :+: +:+:+: :+:+:+ :+: \n+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+:+ +:+ +:+ \n+#++:++#: +#++:++# +#++:++#++: +#+ +:+ +#+ +:+ +#+ +#++:++# \n+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ \n#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# \n### ### ########## ### ### ######### ### ### ##########\n\n\n'
cls(); print(align(read_me.replace(":",f"{reset}:").replace("+",f"{white}+").replace("#",f"{red}#")))
cls(); print(align(read_me.replace(":",f"{white_normal}:").replace("+",f"{white_bright}+").replace("#",f"{red_normal}#")))

def file_downloader(url):
file_name = url.split('/')[-1]
while True:
try:
data = requests.get(url, headers={'User-Agent': 'dank.tool', 'Content-Type': 'application/json'}, timeout=1, allow_redirects=True).content
data = requests.get(url, headers={'User-Agent': 'dank.tool', 'Content-Type': 'application/json'}, timeout=3, allow_redirects=True).content
with open(file_name,"wb") as _:
_.write(data)
break
Expand All @@ -47,7 +46,7 @@ def main():

title("𝚍𝚊𝚗𝚔.𝚊𝚌𝚛𝚘𝚙𝚘𝚕𝚒𝚜")
banner = '\n\n __ __ __ __ __ __ __ \n| \\ /\\ |\\ | |__/ /\\ / ` |__) / \\ |__) / \\ | | /__` \n|__/ /~~\\ | \\| | \\ ./~~\\ \\__, | \\ \\__/ | \\__/ |___ | .__/ \n\n\n'
cls(); print(clr(align(banner),4,colours=(white, white_normal, red, red_normal, red_dim)))
cls(); print(clr(align(banner),4,colours=(red, red_dim)))
print(clr("\n - Credits to u/Verix- from r/GenP | Based on Acropolis v24.1"))
print(clr(f"\n - {translate('Uninstall Adobe Acrobat before proceeding')}!"))
input(clr(f"\n > {translate('Hit [ ENTER ] to begin installation')}... "))
Expand All @@ -73,7 +72,7 @@ def main():
if not os.path.isdir('Patches'):
os.mkdir('Patches')
os.chdir('Patches')
patched_files = ['Acrobat.dll', 'acrodistdll.dll', 'acrotray.exe']
patched_files = ('Acrobat.dll', 'acrodistdll.dll', 'acrotray.exe')
for file in patched_files:
if not os.path.isfile(file):
print(clr(f"\n - {translate(f'Downloading Patched {file}')}..."))
Expand Down
10 changes: 5 additions & 5 deletions __modules__/dank.browser-backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import datetime
from psutil import process_iter
from translatepy import Translator
from dankware import white, white_normal, red, red_normal, red_dim
from dankware import red, red_dim
from dankware import title, cls, clr, err, align, rm_line, is_admin, export_registry_keys, get_path

from rich.live import Live
Expand All @@ -14,7 +14,6 @@
from rich.progress import Progress, SpinnerColumn, BarColumn, TextColumn, TimeRemainingColumn, TimeElapsedColumn

def translate(text):

if DANK_TOOL_LANG:
try: text = translator.translate(text, source_language='en', destination_language=DANK_TOOL_LANG).result
except: pass
Expand Down Expand Up @@ -46,7 +45,8 @@ def backup(browser, compression_level):
print(clr(f"\n - {translate('Invalid Path')}: {path_to_backup}\n",2))
while True:
path_to_backup = input(clr(f" > {translate('Input user data folder path')}: ")); rm_line()
if os.path.exists(path_to_backup) and r"Google\Chrome\User Data" in path_to_backup: break
if os.path.exists(path_to_backup) and r"Google\Chrome\User Data" in path_to_backup:
break

# check if chrome is running

Expand Down Expand Up @@ -82,7 +82,7 @@ def backup(browser, compression_level):
job_progress = Progress("{task.description}", SpinnerColumn(), BarColumn(bar_width=width), TextColumn("[progress.percentage][bright_green]{task.percentage:>3.0f}%"), "[bright_cyan]ETA", TimeRemainingColumn(), TimeElapsedColumn())
overall_task = job_progress.add_task("[bright_green]Compressing", total=num_source_files)
progress_table = Table.grid()
progress_table.add_row(Panel.fit(job_progress, title="[bright_white]Jobs", border_style="bright_red", padding=(1, 2)))
progress_table.add_row(Panel.fit(job_progress, title="[bright_white]Jobs", border_style="red", padding=(1, 2)))

with Live(progress_table, refresh_per_second=10):
with zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED, True, compression_level, strict_timestamps=False) as zipf:
Expand Down Expand Up @@ -144,7 +144,7 @@ def main():
for _, browser in enumerate(browsers):
to_print += f"\n - [{_+1}] {browser}"

print(align(clr(banner,4,colours=(white, white_normal, red, red_normal, red_dim))))
print(align(clr(banner,4,colours=(red, red_dim))))
print(clr(to_print))

print("")
Expand Down
14 changes: 7 additions & 7 deletions __modules__/dank.chatroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from win11toast import notify
from zlib import compress, decompress
from concurrent.futures import ThreadPoolExecutor
from dankware import cls, clr, align, rm_line, green, red, white_normal, title
from dankware import cls, clr, align, rm_line, green_bright, red, white_normal, title

def chatroom_login():

Expand All @@ -34,7 +34,7 @@ def chatroom_login():
err_msg = ""
while True:

username = input(clr(f"\n > Username{err_msg}: ") + green).strip()
username = input(clr(f"\n > Username{err_msg}: ") + green_bright).strip()
if len(username.replace(' ','')) < 3:
err_msg = f" [{red}too short!]"
rm_line(); rm_line(); continue
Expand Down Expand Up @@ -111,9 +111,9 @@ def chatroom_output():
)

if line.startswith("[dank.server]"):
chat[_] = clr(line, colour_two=green)
chat[_] = clr(line, colour_two=green_bright)
elif line.startswith("[SirDank]"):
chat[_] = clr(line.replace("[SirDank]",f"[{green}SirDank{red}]"))
chat[_] = clr(line.replace("[SirDank]",f"[{green_bright}SirDank{red}]"))
elif line.startswith(f"[{username}]"):
chat[_] = clr(line)
else:
Expand All @@ -129,7 +129,7 @@ def chatroom_input():

global running

help_msg = clr("[dank.tool] > /help - show help\n[dank.tool] > /clear - clear chatroom\n[dank.tool] > /notify - enable/disable notifications\n[dank.tool] > /exit - exit chatroom", colour_two=green)
help_msg = clr("[dank.tool] > /help - show help\n[dank.tool] > /clear - clear chatroom\n[dank.tool] > /notify - enable/disable notifications\n[dank.tool] > /exit - exit chatroom", colour_two=green_bright)
print(help_msg)

def handle_msg(event): # pylint: disable=unused-argument
Expand All @@ -152,7 +152,7 @@ def handle_msg(event): # pylint: disable=unused-argument
elif msg_lower in ["/notify", "/notifications"]:
global notifications
notifications = not notifications
print(clr(f"[dank.tool] > Notifications {'enabled' if notifications else 'disabled'}!", colour_two=green))
print(clr(f"[dank.tool] > Notifications {'enabled' if notifications else 'disabled'}!", colour_two=green_bright))

elif msg_lower == "/help":
print(help_msg)
Expand Down Expand Up @@ -238,7 +238,7 @@ def on_closing():

root.destroy()
running = False
print(clr("[dank.tool] > shutting down chatroom...", colour_two=green))
print(clr("[dank.tool] > shutting down chatroom...", colour_two=green_bright))

def enable_notifications():

Expand Down
1 change: 1 addition & 0 deletions __modules__/dank.game.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- This game is in early development, expect bugs!
- The error reporting system does not support this game, please report bugs manually!
- If the ground is not visible, restart the game!
- You might need to use max brightness!
- Game updates might be slow!
- Built with Ursina Engine!
Expand Down
28 changes: 13 additions & 15 deletions __modules__/dank.minecraft-server-builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@
import requests
import subprocess
from translatepy import Translator
from dankware import white, white_normal, red, red_normal, red_dim, reset
from dankware import white_normal, white_bright, red, red_normal, red_dim
from dankware import title, rm_line, align, cls, clr, github_file_selector, multithread, sys_open, err, get_path

headers = {'User-Agent': 'dank.tool', 'Content-Type': 'application/json'}

# banners

def print_banner():
cls(); print(align(clr(banner,4,colours=(white, white_normal, red, red_normal, red_dim)) + f"\n{white}s i r {red}. {white}d a n k {red}💕\n\n"))
banner = "\n\n _ _ _ _ _ _ ___ \n _| |___ ___| |_ ___ ___ ___ _ _ ___ ___ ___| |_ _ _|_| |_| |___ ___ |_ |\n| . | .'| | '_|_|_ -| -_| _| | | -_| _|___| . | | | | | . | -_| _| |_ |\n|___|__,|_|_|_,_|_|___|___|_| \\_/|___|_| |___|___|_|_|___|___|_| |___|\n\n\n"
cls(); print(align(clr(banner,4,colours=(red, red_dim))))

def print_read_me():
cls(); print(align(read_me.replace(":",f"{reset}:").replace("+",f"{white}+").replace("#",f"{red}#")))
read_me = '\n\n::::::::: :::::::::: ::: ::::::::: :::: :::: ::::::::::\n:+: :+: :+: :+: :+: :+: :+: +:+:+: :+:+:+ :+: \n+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+:+ +:+ +:+ \n+#++:++#: +#++:++# +#++:++#++: +#+ +:+ +#+ +:+ +#+ +#++:++# \n+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ \n#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# \n### ### ########## ### ### ######### ### ### ##########\n\n\n'
cls(); print(align(read_me.replace(":",f"{white_normal}:").replace("+",f"{white_bright}+").replace("#",f"{red_normal}#")))

# translator

def translate(text):

if DANK_TOOL_LANG:
try: text = translator.translate(text, source_language='en', destination_language=DANK_TOOL_LANG).result
except: pass
return text

def main_one():

global banner, read_me, name, version, cracked, install_Via, ram, motd_spaces, playit, extra_flag, dir_name, latest_java_version, translator, DANK_TOOL_LANG
global name, version, cracked, install_Via, ram, motd_spaces, playit, extra_flag, dir_name, latest_java_version, translator, DANK_TOOL_LANG

# check if translator is enabled (dank.tool.exe)

Expand All @@ -43,9 +44,6 @@ def main_one():

title("𝚍𝚊𝚗𝚔.𝚖𝚒𝚗𝚎𝚌𝚛𝚊𝚏𝚝-𝚜𝚎𝚛𝚟𝚎𝚛-𝚋𝚞𝚒𝚕𝚍𝚎𝚛")

banner = "\n\n\n _ _ _ _ _ _ ___ \n _| |___ ___| |_ ___ ___ ___ _ _ ___ ___ ___| |_ _ _|_| |_| |___ ___ |_ |\n| . | .'| | '_|_|_ -| -_| _| | | -_| _|___| . | | | | | . | -_| _| |_ |\n|___|__,|_|_|_,_|_|___|___|_| \\_/|___|_| |___|___|_|_|___|___|_| |___|\n"
read_me = '\n\n::::::::: :::::::::: ::: ::::::::: :::: :::: ::::::::::\n:+: :+: :+: :+: :+: :+: :+: +:+:+: :+:+:+ :+: \n+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+:+ +:+ +:+ \n+#++:++#: +#++:++# +#++:++#++: +#+ +:+ +#+ +:+ +#+ +#++:++# \n+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ \n#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# \n### ### ########## ### ### ######### ### ### ##########\n\n\n'

# change dir and print banner

try: os.chdir(get_path('Desktop'))
Expand All @@ -57,7 +55,7 @@ def main_one():

while True:
try:
latest_java_version = requests.get("https://api.adoptium.net/v3/info/available_releases", headers=headers, timeout=1).json()['available_releases'][-1]
latest_java_version = requests.get("https://api.adoptium.net/v3/info/available_releases", headers=headers, timeout=3).json()['most_recent_feature_release']
break
except Exception as exc:
input(clr(f"\n > {translate('Failed to get latest java version!')} {exc} | {translate('Press [ ENTER ] to try again')}... ",2))
Expand All @@ -77,7 +75,7 @@ def main_one():

while True:
try:
version_list = requests.get("https://api.purpurmc.org/v2/purpur", headers=headers, timeout=1).json()['versions']
version_list = requests.get("https://api.purpurmc.org/v2/purpur", headers=headers, timeout=3).json()['versions']
print(clr(f' - {translate("Available Purpur Versions")}: {", ".join(version_list)}')); break
except Exception as exc:
input(clr(f"\n > {translate(f'Failed to get purpur versions! {exc} | Press [ ENTER ] to try again')}... ",2))
Expand Down Expand Up @@ -164,7 +162,7 @@ def main_one():
if playit in ("1","2"):
playit = bool(playit == "1")
break
else: rm_line()
rm_line()

# create and go to workspace

Expand Down Expand Up @@ -283,15 +281,15 @@ def file_downloader(url, file_name):

while True:
try:
response = requests.get(url, headers=headers, timeout=1, allow_redirects=True)
response = requests.get(url, headers=headers, timeout=3, allow_redirects=True)
data = response.content
try: size = '{:.3}'.format(int(response.headers['Content-Length'])/1024000)
except: size = "?"
with open(file_name,"wb") as _:
_.write(data)
print(clr(f" - {translate('Downloaded')} [ {file_name} ] [ {size} MB ]\n")); break
except:
input(clr(f" > {translate('Failed')} [ {file_name} ] Press {white}ENTER{red} to try again... \n",2))
input(clr(f" > {translate('Failed')} [ {file_name} ] Press ENTER to try again... \n",2))
rm_line(); rm_line()

# disabled due to repeated error reports
Expand Down Expand Up @@ -769,7 +767,7 @@ def config_updater(path):
try: config_updater(path); break
except:
string = translate('Press [ ENTER ] to retry or type "skip" to skip')
choice = input(clr(f"\n{err(sys.exc_info(),'mini')}\n\n > {string}: ", 2) + white)
choice = input(clr(f"\n{err(sys.exc_info(),'mini')}\n\n > {string}: ", 2) + white_bright)
if choice == "skip": break

if playit:
Expand Down Expand Up @@ -817,5 +815,5 @@ def config_updater(path):
main_two()

if __name__ == "__main__" and "DANK_TOOL_VERSION" in os.environ:
for _ in ('banner', 'read_me', 'name', 'version', 'cracked', 'install_Via', 'ram', 'motd_spaces', 'playit', 'extra_flag', 'dir_name', 'configs', 'headers', 'latest_java_version', 'translator', 'print_banner', 'print_read_me', 'main_one', 'main_two', 'translate'):
for _ in ('name', 'version', 'cracked', 'install_Via', 'ram', 'motd_spaces', 'playit', 'extra_flag', 'dir_name', 'configs', 'headers', 'latest_java_version', 'translator', 'print_banner', 'print_read_me', 'main_one', 'main_two', 'translate'):
if _ in globals(): del globals()[_]
10 changes: 5 additions & 5 deletions __modules__/dank.minecraft-server-scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from translatepy import Translator
from concurrent.futures import ThreadPoolExecutor
from mcstatus import JavaServer, BedrockServer
from dankware import white, white_normal, red, red_normal, red_dim
from dankware import red, red_dim
from dankware import multithread, clr, cls, title, align, rm_line, random_ip, get_path

'''
Expand Down Expand Up @@ -70,7 +70,7 @@ def check(ip, server):
except: pass

try:
response = requests.get(f"http://ipwho.is/{ip}", timeout=1).json()
response = requests.get(f"http://ipwho.is/{ip}", timeout=3).json()
if response['success']:
server_info = f"{response['city']} | {response['connection']['org']} | {response['connection']['domain']}"
else:
Expand Down Expand Up @@ -122,13 +122,13 @@ def main():
# get user input

title("𝚍𝚊𝚗𝚔.𝚖𝚒𝚗𝚎𝚌𝚛𝚊𝚏𝚝-𝚜𝚎𝚛𝚟𝚎𝚛-𝚜𝚌𝚊𝚗𝚗𝚎𝚛"); banner = '\n\n _ _ \n | | | | \n _ | | ____ ____ | | _ ____ ____ ___ ___ ____ ____ ____ ____ ____ ____ \n / || |/ _ | _ \\| | / ) | \\ / ___|___)___)/ ___) _ | _ \\| _ \\ / _ )/ ___)\n( (_| ( ( | | | | | |< ( _| | | ( (___ |___ ( (__( ( | | | | | | | ( (/ /| | \n \\____|\\_||_|_| |_|_| \\_|_)_|_|_|\\____) (___/ \\____)_||_|_| |_|_| |_|\\____)_| \n \n'
cls(); print(align(clr(banner,4,colours=(white, white_normal, red, red_normal, red_dim))))
cls(); print(align(clr(banner,4,colours=(red, red_dim))))
print(clr(f"\n - Java Server List: https://dank-site.onrender.com/minecraft-java-servers\n\n - Bedrock Server List: https://dank-site.onrender.com/minecraft-bedrock-servers\n\n - {translate('You can use the above links to get a list of servers that have been found by the users of this tool')}!"))
choice = input(clr("\n - 1: Open Java Server List | 2: Open Bedrock Server List | ENTER: Skip\n\n > Choice [1/2/ENTER]: ") + red)
if choice == "1": os.system("start https://dank-site.onrender.com/minecraft-java-servers")
elif choice == "2": os.system("start https://dank-site.onrender.com/minecraft-bedrock-servers")

cls(); print(align(clr(banner,4,colours=(white, white_normal, red, red_normal, red_dim))))
cls(); print(align(clr(banner,4,colours=(red, red_dim))))
print(clr(f"\n - {translate('Start with 100 threads and note the performance impact')}.\n\n - {translate('Generally should be smooth upto 500 threads, you might notice some performance impact above this value')}!\n\n - {translate('Test it for the first time with 50000 IPs, it will take a few seconds to generate')}."))

print("")
Expand All @@ -155,7 +155,7 @@ def main():
rm_line()

if server_type == "java":
cls(); print(align(clr(banner,4,colours=(white, white_normal, red, red_normal, red_dim))))
cls(); print(align(clr(banner,4,colours=(red, red_dim))))
print(clr(f"\n - [0] {translate('Default Scan: Generates completely random IPs, good chance to find private / locally hosted servers, low find-rate')}.\n\n - [1] {translate('Targetted Scan: Generates random IPs based on custom rules, good chance to find data center servers, high find-rate')}."))

print("")
Expand Down
Loading

0 comments on commit 5266f05

Please sign in to comment.