Skip to content

Commit

Permalink
Merge pull request #8 from SirDank/dev
Browse files Browse the repository at this point in the history
Dev 3.1

Former-commit-id: d1fda1c
  • Loading branch information
SirDank authored Aug 23, 2023
2 parents 2fa01c1 + 7c7ede5 commit ecc7a1c
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 243 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- [ ] Add google translate for dank.tool
- [ ] Finish reworking dank.downloader.py
- [ ] Add dank.proxy.py ( scraper / checker )
- [ ] Add Linux Wine Support
- [ ] Add Linux Support

## ♦️ Support ♦️
Expand Down
550 changes: 313 additions & 237 deletions __src__/dank.tool.py

Large diffs are not rendered by default.

40 changes: 38 additions & 2 deletions __src__/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
import pyminizip
import subprocess
import tkinter as tk
from locale import getlocale
from win11toast import notify
from psutil import process_iter
from playsound import playsound
from mcstatus import JavaServer
from translatepy import Translator
from gzip import compress, decompress
from dateutil.tz import tzlocal, tzutc
from pynput.keyboard import Key, Listener
Expand All @@ -51,7 +53,7 @@

# variables

DANK_TOOL_VERSION = "3.0.1"
DANK_TOOL_VERSION = "3.1"
session = requests.Session()
executor = ThreadPoolExecutor(10)
headers = {"User-Agent": "dank.tool"}
Expand Down Expand Up @@ -136,6 +138,40 @@ def dank_tool_installer():
else: # LATEST VERSION IS LESS THAN CURRENT VERSION
print(clr("\n > Development Version!"))

# check windows language

def check_windows_language():

locale_name = getlocale()[0]
if '-' in locale_name and not '_' in locale_name:
locale_name = locale_name.split('-')[0]
elif '_' in locale_name and not '-' in locale_name:
locale_name = locale_name.split('_')[0]
else:
for _ in locale_name:
if _ == '-':
locale_name = locale_name.split('-')[0]
break
elif _ == '_':
locale_name = locale_name.split('_')[0]
break

if not locale_name.lower().startswith('en'):
translator = Translator()
result = translator.translate("Would you like to enable the translate feature?", source_language='en', destination_language=locale_name)
print(clr(f"\n > Your windows language is set to '{cyan}{locale_name}'!"))
if input(clr(f"\n > {result} [y/n]:", colour_one=cyan)).lower() == 'y':
os.environ['DANK_TOOL_LANG'] = locale_name
else:
os.environ['DANK_TOOL_LANG'] = "en"
else:
os.environ['DANK_TOOL_LANG'] = "en"

if ONLINE_MODE:
check_windows_language()
else:
os.environ['DANK_TOOL_LANG'] = "en"

# get and save dank.tool.py

if not os.path.exists('__src__'): os.mkdir('__src__')
Expand Down Expand Up @@ -225,7 +261,7 @@ def dank_tool_chatroom():

if "Error Type: KeyboardInterrupt" in err_message:
print_warning_symbol()
print(clr("\n > Please do not use [ CTRL + C ] when running the dank.tool!"))
print(clr("\n > Please select text first and then use [ CTRL + C ]!"))

elif parse(LATEST_VERSION) > parse(DANK_TOOL_VERSION):
print(clr(f"\n > Updating to the latest version...\n\n > Update Found: {LATEST_VERSION}"))
Expand Down
2 changes: 1 addition & 1 deletion __src__/executor_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1
3.1
5 changes: 5 additions & 0 deletions __src__/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
except:
cls(); input(clr(f"\n > Failed to extract!\n > Please manually extract and install from \"{os.path.join(os.getcwd(), 'dank.tool.zip')}\"\n > Press [ENTER] to EXIT... ",2))
sys.exit("Failed to extract file!")

try: os.remove("password = dankware")
except: pass
try: os.remove("dank.tool.zip")
except: pass

input(clr("\n > Press [ENTER] to install the latest version of dank.tool... "))
os.system("start dank.tool-[installer].exe")
Expand Down
1 change: 0 additions & 1 deletion dank.tool.exe.REMOVED.git-id

This file was deleted.

2 changes: 1 addition & 1 deletion dank.tool.zip.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
347029d3b3f91ca10570f4241524219735b84e2a
72bb201a3a80d422b36b29c6f9f3d816781da264
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ python-dateutil
requests
rich
unitypackff
win11toast
win11toast
translatepy

0 comments on commit ecc7a1c

Please sign in to comment.