-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c2e43e
commit 73a39d7
Showing
1 changed file
with
15 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,33 @@ | ||
import requests | ||
import colorama | ||
import os | ||
try: | ||
import requests | ||
except ImportError: | ||
os.system("pip install requests") | ||
|
||
os.system(f"title Cwelium Downloader") | ||
|
||
stars = requests.get(f"https://api.github.com/repos/Tips-Discord/Cwelium").json()["stargazers_count"] | ||
|
||
menu = f""" | ||
{'██████╗ ██████╗ ██╗ ██╗███╗ ██╗██╗ ██████╗ █████╗ ██████╗ ███████╗██████╗ '.center(os.get_terminal_size().columns)} | ||
{'██╔══██╗██╔═══██╗██║ ██║████╗ ██║██║ ██╔═══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗'.center(os.get_terminal_size().columns)} | ||
{'██║ ██║██║ ██║██║ █╗ ██║██╔██╗ ██║██║ ██║ ██║███████║██║ ██║█████╗ ██████╔╝'.center(os.get_terminal_size().columns)} | ||
{'██║ ██║██║ ██║██║███╗██║██║╚██╗██║██║ ██║ ██║██╔══██║██║ ██║██╔══╝ ██╔══██╗'.center(os.get_terminal_size().columns)} | ||
{'██████╔╝╚██████╔╝╚███╔███╔╝██║ ╚████║███████╗╚██████╔╝██║ ██║██████╔╝███████╗██║ ██║'.center(os.get_terminal_size().columns)} | ||
{'╚═════╝ ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝'.center(os.get_terminal_size().columns)} | ||
{f'Stars {stars}'.center(os.get_terminal_size().columns)}""" | ||
|
||
def download_latest_release(): | ||
try: | ||
response = requests.get("https://api.github.com/repos/Tips-Discord/Cwelium/releases/latest") | ||
response.raise_for_status() | ||
release_info = response.json() | ||
asset_url = release_info['assets'][0]['browser_download_url'] | ||
|
||
response = requests.get(asset_url) | ||
response = requests.get(response.json()['assets'][0]['browser_download_url']) | ||
response.raise_for_status() | ||
|
||
with open(f"Cwelium.exe", "wb") as file: | ||
file.write(response.content) | ||
|
||
file.write(response.content) | ||
except requests.exceptions.RequestException as e: | ||
print(f"Error: {e}") | ||
|
||
|
||
if __name__ == "__main__": | ||
print(menu) | ||
print(f""" | ||
{'██████╗ ██████╗ ██╗ ██╗███╗ ██╗██╗ ██████╗ █████╗ ██████╗ ███████╗██████╗ '.center(os.get_terminal_size().columns)} | ||
{'██╔══██╗██╔═══██╗██║ ██║████╗ ██║██║ ██╔═══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗'.center(os.get_terminal_size().columns)} | ||
{'██║ ██║██║ ██║██║ █╗ ██║██╔██╗ ██║██║ ██║ ██║███████║██║ ██║█████╗ ██████╔╝'.center(os.get_terminal_size().columns)} | ||
{'██║ ██║██║ ██║██║███╗██║██║╚██╗██║██║ ██║ ██║██╔══██║██║ ██║██╔══╝ ██╔══██╗'.center(os.get_terminal_size().columns)} | ||
{'██████╔╝╚██████╔╝╚███╔███╔╝██║ ╚████║███████╗╚██████╔╝██║ ██║██████╔╝███████╗██║ ██║'.center(os.get_terminal_size().columns)} | ||
{'╚═════╝ ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝'.center(os.get_terminal_size().columns)} | ||
{f'Stars {requests.get(f"https://api.github.com/repos/Tips-Discord/Cwelium").json()["stargazers_count"]}'.center(os.get_terminal_size().columns)}""") | ||
download_latest_release() | ||
os.system("start Cwelium.exe") |