6464LOADER_UPDATE_FILE = UPDATE_PATH / 'addons' / f'source-python.{ BINARY_EXT } '
6565VDF_UPDATE_FILE = UPDATE_PATH / 'addons' / 'source-python.vdf'
6666
67- CHECKSUM_URL = 'http://data.sourcepython.com/checksum.txt'
68- DATA_URL = 'http://data.sourcepython.com/source-python-data.zip'
69- ARTIFACTS_URL = 'http://builds.sourcepython.com/job/Source.Python/lastSuccessfulBuild/api/json?tree=artifacts[relativePath]'
70- BASE_DOWNLOAD_URL = 'http://builds.sourcepython.com/job/Source.Python/lastSuccessfulBuild/artifact/'
67+ BASE_DATA_URL = 'http://data.sourcepython.com'
68+ CHECKSUM_URL = f'{ BASE_DATA_URL } /checksum.txt'
69+ DATA_URL = f'{ BASE_DATA_URL } /source-python-data.zip'
70+
71+ BASE_DOWNLOAD_URL = 'http://downloads.sourcepython.com'
72+ ARTIFACTS_URL = f'{ BASE_DOWNLOAD_URL } /artifacts.txt'
73+
7174DEFAULT_TIMEOUT = 3
7275
7376#: Indicates, whether an update is in progress (stage 1 has been applied).
@@ -140,9 +143,7 @@ def get_build_artifacts(timeout=DEFAULT_TIMEOUT):
140143 """
141144 update_logger .log_debug ('Getting artifacts...' )
142145 with urlopen (ARTIFACTS_URL , timeout = timeout ) as url :
143- data = json .loads (url .read ())
144- for d in data ['artifacts' ]:
145- yield d ['relativePath' ]
146+ return url .read ().decode ('utf-8' ).split ('\n ' )
146147
147148def get_download_url (game = SOURCE_ENGINE_BRANCH , timeout = DEFAULT_TIMEOUT ):
148149 """Get the latest Source.Python download URL for a specific game.
@@ -157,7 +158,7 @@ def get_download_url(game=SOURCE_ENGINE_BRANCH, timeout=DEFAULT_TIMEOUT):
157158 """
158159 for relative_path in get_build_artifacts (timeout ):
159160 if f'-{ game } -' in relative_path :
160- return BASE_DOWNLOAD_URL + relative_path
161+ return f' { BASE_DOWNLOAD_URL } / { relative_path } '
161162
162163 raise ValueError (f'Unable to find a download URL for game "{ game } ".' )
163164
0 commit comments