mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[api] Allow specifying label and platform in API requests
This commit is contained in:
parent
f5861546b4
commit
79dc7d03a4
|
@ -91,16 +91,16 @@ class EPCAPI:
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return r.content
|
return r.content
|
||||||
|
|
||||||
def get_game_assets(self):
|
def get_game_assets(self, platform='Windows', label='Live'):
|
||||||
r = self.session.get(f'https://{self._launcher_host}/launcher/api/public/assets/Windows',
|
r = self.session.get(f'https://{self._launcher_host}/launcher/api/public/assets/{platform}',
|
||||||
params=dict(label='Live'))
|
params=dict(label=label))
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return r.json()
|
return r.json()
|
||||||
|
|
||||||
def get_game_manifest(self, namespace, catalog_item_id, app_name):
|
def get_game_manifest(self, namespace, catalog_item_id, app_name, platform='Windows', label='Live'):
|
||||||
r = self.session.get(f'https://{self._launcher_host}/launcher/api/public/assets/v2/platform'
|
r = self.session.get(f'https://{self._launcher_host}/launcher/api/public/assets/v2/platform'
|
||||||
f'/Windows/namespace/{namespace}/catalogItem/{catalog_item_id}/app'
|
f'/{platform}/namespace/{namespace}/catalogItem/{catalog_item_id}/app'
|
||||||
f'/{app_name}/label/Live')
|
f'/{app_name}/label/{label}')
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return r.json()
|
return r.json()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue