From fa729e056df0977fe911973a4e523e097a8e2875 Mon Sep 17 00:00:00 2001 From: Lertsenem Date: Fri, 26 Aug 2022 09:09:58 +0200 Subject: [PATCH] Change smash.gg URLs to start.gg The package name stays the same though. start.gg is only added as another URL for smash.gg, and used as replacement for the "api.smash.gg" URL, in case the old one become deprecated. --- lokrez/__init__.py | 4 ++-- lokrez/smashgg.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lokrez/__init__.py b/lokrez/__init__.py index 4416b00..f82ba8e 100644 --- a/lokrez/__init__.py +++ b/lokrez/__init__.py @@ -192,7 +192,7 @@ def get_infos_from_url( url_parsed = urllib.parse.urlparse(url) - if url_parsed.netloc not in [ "smash.gg" ]: + if url_parsed.netloc not in [ "smash.gg", "start.gg" ]: raise ValueError("Unsupported domain name") if outform not in [ "dict", "lkrz" ]: raise ValueError("Unsupported outform") @@ -202,7 +202,7 @@ def get_infos_from_url( event = None # ------------------------------------------------------------------------- - if url_parsed.netloc == "smash.gg": + if url_parsed.netloc in [ "smash.gg", "start.gg" ]: if (url_parsed.path.split("/")[1] != "tournament"): log.error("Incomplete URL '{}'".format(url)) diff --git a/lokrez/smashgg.py b/lokrez/smashgg.py index 51c14db..1e8aeeb 100644 --- a/lokrez/smashgg.py +++ b/lokrez/smashgg.py @@ -8,7 +8,7 @@ import requests from .games import ssbu, melee, pplus # ============================================================================= -API_HOST = "api.smash.gg" +API_HOST = "api.start.gg" API_ENDPOINT = "gql/alpha" API_SCHEME = "https" API_URL = "{scheme}://{host}/{endpoint}".format(