diff --git a/main.py b/main.py index faecdb6..ff66d5d 100644 --- a/main.py +++ b/main.py @@ -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): @@ -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) @@ -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}")) @@ -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" @@ -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"└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘") @@ -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?') diff --git a/requirements.txt b/requirements.txt index ec7e38f..b708790 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ lastversion ping3 filelock tqdm -psutil +psutil \ No newline at end of file diff --git a/xtools.py b/xtools.py index d1d1f0a..ac564f0 100644 --- a/xtools.py +++ b/xtools.py @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" + ) ] ), @@ -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" ) + ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ), @@ -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" ) ] ),