diff --git a/Src/Upload/update.py b/Src/Upload/update.py index e92c2f7..d408854 100644 --- a/Src/Upload/update.py +++ b/Src/Upload/update.py @@ -5,7 +5,7 @@ import time # Internal utilities -from .version import __version__ +from .version import __version__, __author__, __title__ from Src.Util.console import console @@ -14,8 +14,6 @@ import httpx # Variable -repo_name = "StreamingCommunity_api" -repo_user = "ghost6446" main = os.path.abspath(os.path.dirname(__file__)) @@ -28,8 +26,8 @@ def update(): # Make the GitHub API requests and handle potential errors try: - response_reposity = httpx.get(f"https://api.github.com/repos/{repo_user}/{repo_name}").json() - response_releases = httpx.get(f"https://api.github.com/repos/{repo_user}/{repo_name}/releases").json() + response_reposity = httpx.get(f"https://api.github.com/repos/{__author__}/{__title__}").json() + response_releases = httpx.get(f"https://api.github.com/repos/{__author__}/{__title__}/releases").json() except Exception as e: console.print(f"[red]Error accessing GitHub API: {e}") @@ -60,7 +58,7 @@ def update(): console.print(f"[red]Everything is up to date") console.print("\n") - console.print(f"[red]{repo_name} has been downloaded [yellow]{total_download_count} [red]times, but only [yellow]{percentual_stars}% [red]of users have starred it.\n\ + console.print(f"[red]{__title__} has been downloaded [yellow]{total_download_count} [red]times, but only [yellow]{percentual_stars}% [red]of users have starred it.\n\ [cyan]Help the repository grow today by leaving a [yellow]star [cyan]and [yellow]sharing [cyan]it with others online!") console.print("\n") diff --git a/Src/Upload/version.py b/Src/Upload/version.py index c69e058..bc501f4 100644 --- a/Src/Upload/version.py +++ b/Src/Upload/version.py @@ -1,5 +1,5 @@ __title__ = 'StreamingCommunity' -__version__ = 'v1.1.0' +__version__ = 'v1.2.0' __author__ = 'Lovi-0' __description__ = 'A command-line program to download film' __copyright__ = 'Copyright 2024' diff --git a/run.py b/run.py index c22faa0..cf1c764 100644 --- a/run.py +++ b/run.py @@ -110,10 +110,8 @@ def initialize(): sys.exit(0) # Attempting GitHub update - try: - git_update() - except Exception as e: - console.print(f"[blue]Req github [white]=> [red]Failed: {e}") + git_update() + def main():