Browse Source

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.
Lertsenem 1 year ago
parent
commit
fa729e056d
2 changed files with 3 additions and 3 deletions
  1. 2 2
      lokrez/__init__.py
  2. 1 1
      lokrez/smashgg.py

+ 2 - 2
lokrez/__init__.py

@@ -192,7 +192,7 @@ def get_infos_from_url(
192 192
 
193 193
     url_parsed = urllib.parse.urlparse(url)
194 194
 
195
-    if url_parsed.netloc not in [ "smash.gg" ]:
195
+    if url_parsed.netloc not in [ "smash.gg", "start.gg" ]:
196 196
         raise ValueError("Unsupported domain name")
197 197
     if outform not in [ "dict", "lkrz" ]:
198 198
         raise ValueError("Unsupported outform")
@@ -202,7 +202,7 @@ def get_infos_from_url(
202 202
     event = None
203 203
 
204 204
     # -------------------------------------------------------------------------
205
-    if url_parsed.netloc == "smash.gg":
205
+    if url_parsed.netloc in [ "smash.gg", "start.gg" ]:
206 206
 
207 207
         if (url_parsed.path.split("/")[1] != "tournament"):
208 208
             log.error("Incomplete URL '{}'".format(url))

+ 1 - 1
lokrez/smashgg.py

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