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.
master
Lertsenem 2022-08-26 09:09:58 +02:00
parent 4d983bb080
commit fa729e056d
2 changed files with 3 additions and 3 deletions

View File

@ -192,7 +192,7 @@ def get_infos_from_url(
url_parsed = urllib.parse.urlparse(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") raise ValueError("Unsupported domain name")
if outform not in [ "dict", "lkrz" ]: if outform not in [ "dict", "lkrz" ]:
raise ValueError("Unsupported outform") raise ValueError("Unsupported outform")
@ -202,7 +202,7 @@ def get_infos_from_url(
event = None event = None
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
if url_parsed.netloc == "smash.gg": if url_parsed.netloc in [ "smash.gg", "start.gg" ]:
if (url_parsed.path.split("/")[1] != "tournament"): if (url_parsed.path.split("/")[1] != "tournament"):
log.error("Incomplete URL '{}'".format(url)) log.error("Incomplete URL '{}'".format(url))

View File

@ -8,7 +8,7 @@ import requests
from .games import ssbu, melee, pplus from .games import ssbu, melee, pplus
# ============================================================================= # =============================================================================
API_HOST = "api.smash.gg" API_HOST = "api.start.gg"
API_ENDPOINT = "gql/alpha" API_ENDPOINT = "gql/alpha"
API_SCHEME = "https" API_SCHEME = "https"
API_URL = "{scheme}://{host}/{endpoint}".format( API_URL = "{scheme}://{host}/{endpoint}".format(