Skip to content

Commit

Permalink
fix: remove update check
Browse files Browse the repository at this point in the history
  • Loading branch information
ZianTT authored Jun 29, 2024
1 parent f94884f commit 815806a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 43 deletions.
42 changes: 0 additions & 42 deletions globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,48 +85,6 @@ def init():
sentry_sdk.set_user({"hwid": machineid.id()[:16]})
return version, sentry_sdk

def check_update(version):
try:
import requests
data = requests.get("https://api.github.com/repos/biliticket/BHYG/releases/latest",
headers={"Accept": "application/vnd.github+json"}).json()
if data["tag_name"] != version:

import platform
if platform.system() == "Windows":
name = "BHYG-Windows.exe"
elif platform.system() == "Linux":
name = "BHYG-Linux"
elif platform.system() == "Darwin":
print(platform.machine())
if "arm" in platform.machine():
name = "BHYG-macOS-Apple_Silicon"
elif "64" in platform.machine():
name = "BHYG-macOS-Intel"
else:
name = "BHYG-macOS"
else:
name = "BHYG"
find = False
for distribution in data["assets"]:
if distribution["name"] == name:
logger.warning(
i18n_gt()["new_version_1"].format(data['tag_name'], distribution['browser_download_url'], distribution['size'] / 1024 / 1024))
if data['body'] != "":
logger.warning(i18n_gt()["new_version_notify"].format(data['body']))
find = True
break
if not find:
logger.warning(i18n_gt()["new_version_2"].format(data['tag_name'], data['html_url']))
if data['body'] != "":
logger.warning(i18n_gt()["new_version_notify"].format(data['body']))
find = True
except KeyboardInterrupt:
logger.error(i18n_gt()["update_interrupted"])
except:
logger.error(i18n_gt()["update_interrupted"])


class HygException(Exception):
pass

Expand Down
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def main():
version, sentry_sdk = init()
session = requests.session()

check_update(version)
check_policy()

config = load_config()
Expand Down
2 changes: 2 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def check_policy():
break
except Exception:
logger.error(i18n_gt()["policy_error"])
if policy["announcement"] is not None:
logger.warning(policy["announcement"])
if "policy" not in locals():
logger.error(i18n_gt()["policy_get_failed"])
sys.exit(1)
Expand Down

0 comments on commit 815806a

Please sign in to comment.