Skip to content

Commit

Permalink
update, upgrade, or however you call it
Browse files Browse the repository at this point in the history
  • Loading branch information
nyxiereal authored Sep 22, 2023
1 parent a27f23f commit 89eace0
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 77 deletions.
68 changes: 26 additions & 42 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
from ping3 import ping
from tqdm import tqdm

from rich.progress import Progress

init(autoreset=True)

peeng = str(f"{round(ping('google.com', unit='ms'))}ms").ljust(7)

version = '2.8'
version = '2.9'

#### XENONIUM FUNCTIONS
def fwrite(run, filename, content):
Expand Down Expand Up @@ -84,58 +86,39 @@ def sys(clr, text):
def zpr(text):
print(Fore.BLUE + f'[>] {text}')

def download(link, fnam, name = None):
def download(url, fnam, name):
try:
if name == None:
name = fnam

# Parse the URL and convert it to https.
link = (urlparse(link))._replace(scheme='https').geturl()

Printer.sys(1, f'Downloading {name}...')

# Configure an HTTP adapter with retries and connection pooling.
adapter = HTTPAdapter(max_retries=3,
pool_connections=20,
pool_maxsize=10)
url = (urlparse(url))._replace(scheme='https').geturl()

# Set some headers for the request.
headers = {'Accept-Encoding': 'gzip, deflate',
'User-Agent': 'Mozilla/5.0',
'cache_control': 'max-age=600',
'connection': 'keep-alive'}

# Create a new session for the request.
'User-Agent': 'Mozilla/5.0',
'cache_control': 'max-age=600',
'connection': 'keep-alive'}

session = Session()

# Mount the HTTP adapter to the session.
session.mount('https://', adapter)

# Use a context manager to download the file and display the progress.
with closing(session.get(link,
allow_redirects=True,
stream=True,
headers=headers)) as r:
response = session.head(url, headers=headers)
total_size = int(response.headers.get("content-length", 0))

# Get the total size of the file.
total_size = int(r.headers.get('content-length', 0))
block_size = 8192 # 8 Kibibytes
with Progress() as progress:
task = progress.add_task(f"[cyan]:: Downloading [bold]{name}[/bold][/cyan]", total=total_size)

# Create a progress bar to display the download progress.
with open(fnam, "wb") as file:

progress_bar = tqdm(total=total_size, unit='iB', unit_scale=True, bar_format='{desc}: {percentage:3.0f}% [{bar}] {n_fmt} / {total_fmt} │ {elapsed} / {remaining} │ {rate_fmt}')
response = session.get(url, stream=True)
chunk_size = 1024 # You can adjust this value as needed

# Open the file for writing and download the file in chunks.
with open(fnam, 'wb') as file:
for data in r.iter_content(block_size):
progress_bar.update(len(data))
# the shits that writes the data and updates the progress bar every 1kib
for data in response.iter_content(chunk_size=chunk_size):
file.write(data)
progress.update(task, completed=file.tell())

# Close the progress bar and print a message when the download is complete.
progress_bar.close()
Printer.sys(1, f'{name} Downloaded!')
except KeyboardInterrupt:
progress_bar.close()
progress.stop()
Printer.sys(0, 'Aborting!')
remove(fnam)

Expand Down Expand Up @@ -417,7 +400,7 @@ def add_spaces(string):

def xget(ide):
try:
if ide in ['t1-1', 'l9-2', 'm6-2', 'm7-2', 't3-2', 'l4-3', 'g2-3', 'c6-3']:
if ide in ['t1-1', 'm6-2', 'm7-2', 't3-2', 'l4-3', 'g2-3', 'c6-3']:
return(cl(1, add_spaces(f" [{(ide.split('-')[0])[1:]}] {tools[ide].name} DNG")))
else:
return(add_spaces(f" [{(ide.split('-')[0])[1:]}] {tools[ide].name}"))
Expand Down Expand Up @@ -454,6 +437,7 @@ def helpe():
def quicktweaks():
global lastPage; lastPage = quicktweaks
cls()
# god is dead
print(f"┌────────────────────────────┬──────────────────────────┐\n"
f"│ [1] {cl(0, 'AntiTrackTime')} │ [7] NoXboxBloat R│\n"
f"│ [2] NoNetworkAuto-Tune │ [8] {cl(1, 'Limit QoS')} R│\n"
Expand Down Expand Up @@ -519,8 +503,8 @@ def p1():
f"│{xget('d12-1') }{xget('t12-1') }{xget('a12-1') }{xget('c12-1') }\n"
f"│{xget('d13-1') }{xget('t13-1') }{xget('a13-1') }{xget('c13-1') }\n"
f"│{xget('d14-1') }{xget('t14-1') }{xget('a14-1') }{xget('c14-1') }\n"
f"│{xget('d15-1') }{xget('t15-1') }{xget('a15-1') }{xget('c15-1') }\n"
f"│{xget('d16-1') }{xget('t16-1') }{xget('a16-1') }{xget('c16-1') }\n"
f"│{xget('d15-1') } [QT] Quick Tweaks{xget('a15-1') }{xget('c15-1') }\n"
f"│{xget('d16-1') } {xget('a16-1') }{xget('c16-1') }\n"
f"├────────────────────────────┴────────────────────────────┴────────────────────────────┴────────────────────────────┤\n"
f"│ Ex.: 'D2' ─ HoneCtrl │ N ─ Next Page │ ^C ─ Exit │ H ─ Help │ I ─ Info 1/3 │\n"
f"└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘")
Expand Down Expand Up @@ -626,13 +610,13 @@ def p3():

# KILL KILL KILL KILL KILL KILL KILL KILL
Printer.zpr('Checking hardware requirements...')
if not cpu_count(logical=True)<3:
if not cpu_count(logical=True)<2:
Printer.sys(1, 'CPU core count requirements met!')
else:
Printer.sys(0, 'Your CPU core count is too low to run XTB, continue anyways?')
if not yn(): exit()

if not virtual_memory().total/1073741824<4:
if not virtual_memory().total/1073741824<2:
Printer.sys(1, 'RAM requirements met!')
else:
Printer.sys(0, 'You have too little RAM in your PC to run XTB, continue anyways?')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ lastversion
ping3
filelock
tqdm
psutil
psutil
59 changes: 25 additions & 34 deletions xtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def getDesc(self, num):
[
Dwn(
"NVCleanstall", "", "NVCleanstall.exe",
r"https://cdn.discordapp.com/attachments/1045063596134117456/1074431416152105090/NVCleanstall_1.15.1.exe"
r"https://de1-dl.techpowerup.com/files/512CeqSa_AEhRNf3RBT6qg/1695441125/NVCleanstall_1.16.0.exe"
)
]
),
Expand All @@ -378,7 +378,7 @@ def getDesc(self, num):
[
Dwn(
"SophiApp", "", "SophiApp.zip",
r"https://github.com/Sophia-Community/SophiApp/releases/download/1.0.94/SophiApp.zip"
r"https://github.com/Sophia-Community/SophiApp/releases/latest/download/SophiApp.zip"
)
]
),
Expand Down Expand Up @@ -440,7 +440,7 @@ def getDesc(self, num):
[
Dwn(
"LibreWolf", "", "LibreWolf-Setup.exe",
r"https://gitlab.com/librewolf-community/browser/windows/-/package_files/69100828/download"
r"https://gitlab.com/api/v4/projects/44042130/packages/generic/librewolf/117.0.1-1/librewolf-117.0.1-1-windows-x86_64-setup.exe"
)
]
),
Expand All @@ -465,7 +465,7 @@ def getDesc(self, num):
[
Dwn(
"Rainmeter", "", "Rainmeter-Setup.exe",
r"https://github.com/rainmeter/rainmeter/releases/download/v4.5.17.3700/Rainmeter-4.5.17.exe"
r"https://github.com/rainmeter/rainmeter/releases/download/v4.5.18.3727/Rainmeter-4.5.18.exe"
)
]
),
Expand All @@ -477,7 +477,7 @@ def getDesc(self, num):
[
Dwn(
"7-Zip", "", "7Zip.exe",
r"https://www.7-zip.org/a/7z2201-x64.exe"
r"https://www.7-zip.org/a/7z2301-x64.exe"
)
]
),
Expand Down Expand Up @@ -1082,7 +1082,7 @@ def getDesc(self, num):
[
Dwn(
"Windows 8.1", "", "Windows-8.1.iso",
r"https://dl.malwarewatch.org/windows/Windows%208.1%20%28x64%29.iso"
r"https://archive.org/download/Windows_8.1_x64.iso/Windows_8.1_x64.iso"
)
]
),
Expand All @@ -1094,7 +1094,7 @@ def getDesc(self, num):
[
Dwn(
"Windows 8", "", "Windows-8.iso",
r"https://dl.malwarewatch.org/windows/Windows%208%20%28x64%29.iso"
r"https://archive.org/download/windows-8_202210/Windows%208.iso"
)
]
),
Expand All @@ -1106,7 +1106,7 @@ def getDesc(self, num):
[
Dwn(
"Windows 7", "", "Windows-7.iso",
r"https://dl.malwarewatch.org/windows/Windows%207%20%28x64%29.iso"
r"https://archive.org/download/windows_7_professional_iso/en_windows_7_professional_x64_dvd.iso"
)
]
),
Expand Down Expand Up @@ -1189,17 +1189,9 @@ def getDesc(self, num):
r"https://github.com/Atlas-OS/",
[
Dwn(
"AtlasOS 21H2", "21H2 + Faceit", "AtlasOS-21H2.iso",
r"https://github.com/Atlas-OS/atlas-releases/releases/download/20H2-v0.5.2/Atlas_v0.5.2_21H2.iso"
),
Dwn(
"AtlasOS 20H2", "20H2 + Better than Old", "AtlasOS-20H2.iso",
r"https://github.com/Atlas-OS/atlas-releases/releases/download/20H2-v0.5.2/Atlas_v0.5.2.iso"
),
Dwn(
"AtlasOS 1803", "1803 + Old version", "AtlasOS-1803.iso",
r"https://github.com/Atlas-OS/atlas-releases/releases/download/1803/Atlas_1803_v0.2.iso"
),
"AtlasOS 22H2", "", "AtlasOS-22H2.apbx",
r"https://github.com/Atlas-OS/Atlas/releases/download/0.2.0/Atlas_W10-22H2.zip"
)
]
),

Expand All @@ -1216,18 +1208,17 @@ def getDesc(self, num):
),

"m4-2" : Tool(
"ReviOS", "m4-2", 1, True,
lambda: "",
"ReviOS", "m4-2", 1, False,
lambda: (str(latest('meetrevision/playbook'))),
r"https://revi.cc/",
[
Dwn(
"ReviOS 11", "", "ReviOS-11.iso",
r"https://pixeldrain.com/api/file/DAatLgjZ?download"
),
Dwn(
"ReviOS 10", "", "ReviOS-10.iso",
r"https://pixeldrain.com/api/file/hyVCKphd?download"
"ReviOS Playbook", "", "ReviOS.apbx",
r"https://github.com/meetrevision/playbook/releases/download/",
r"/Revi-PB-",
r".apbx"
)

]
),

Expand Down Expand Up @@ -1270,7 +1261,7 @@ def getDesc(self, num):
[
Dwn(
"Aero10", "", "Aero10.iso",
r"https://dl.malwarewatch.org/windows/mods/Aero%2010%20%28x64%29.iso"
r"https://archive.org/download/Aero10ENX64/Aero10_EN_x64.iso"
)
]
),
Expand All @@ -1282,7 +1273,7 @@ def getDesc(self, num):
[
Dwn(
"Tiny10", "", "Tiny10.iso",
r"https://dl.malwarewatch.org/windows/mods/Tiny%2010.iso"
r"https://archive.org/download/tiny-10-23-h2/tiny10%20x64%2023h2.iso"
)
]
),
Expand All @@ -1306,7 +1297,7 @@ def getDesc(self, num):
[
Dwn(
"Windows 7 Super Nano", "", "Windows-7-SuperNano.iso",
r"https://dl.malwarewatch.org/windows/Windows%207%20%28SuperNano%29.iso"
r"https://archive.org/download/windows-7-super-nano-2/Windows%207%20%28SuperNano%29.iso"
)
]
),
Expand Down Expand Up @@ -1607,7 +1598,7 @@ def getDesc(self, num):
[
Dwn(
"Paradox", "", "Paradox-Setup.msi",
r"https://launcher.paradoxinteractive.com/v2/paradox-launcher-installer-2023_2_1.msi"
r"https://launcher.paradoxinteractive.com/v2/paradox-launcher-installer-2023_12.msi"
)
]
),
Expand Down Expand Up @@ -1667,7 +1658,7 @@ def getDesc(self, num):
[
Dwn(
"Feather Launcher", "", "FeatherLauncher-Setup.exe",
r"https://launcher.feathercdn.net/dl/Feather%20Launcher%20Setup%201.4.8.exe"
r"https://launcher.feathercdn.net/dl/Feather%20Launcher%20Setup%201.5.7.exe"
)
]
),
Expand All @@ -1679,7 +1670,7 @@ def getDesc(self, num):
[
Dwn(
"Lunar Client", "", "LunarClient-Setup.exe",
r"https://launcherupdates.lunarclientcdn.com/Lunar%20Client%20v2.15.1.exe"
r"https://launcherupdates.lunarclientcdn.com/Lunar%20Client%20v3.1.0.exe"
)
]
),
Expand All @@ -1703,7 +1694,7 @@ def getDesc(self, num):
[
Dwn(
"Badlion Client", "", "BadlionClient-Setup.exe",
r"https://client-updates.badlion.net/Badlion%20Client%20Setup%203.12.2.exe"
r"https://client-updates-cdn77.badlion.net/Badlion%20Client%20Setup%203.18.2.exe"
)
]
),
Expand Down

0 comments on commit 89eace0

Please sign in to comment.