From 79dc7d03a462e2db18bade6b49349830c2f44e6c Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 28 Apr 2020 14:51:00 +0200 Subject: [PATCH] [api] Allow specifying label and platform in API requests --- legendary/api/egs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/legendary/api/egs.py b/legendary/api/egs.py index f0604cd..756ce6b 100644 --- a/legendary/api/egs.py +++ b/legendary/api/egs.py @@ -91,16 +91,16 @@ class EPCAPI: r.raise_for_status() return r.content - def get_game_assets(self): - r = self.session.get(f'https://{self._launcher_host}/launcher/api/public/assets/Windows', - params=dict(label='Live')) + def get_game_assets(self, platform='Windows', label='Live'): + r = self.session.get(f'https://{self._launcher_host}/launcher/api/public/assets/{platform}', + params=dict(label=label)) r.raise_for_status() 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' - f'/Windows/namespace/{namespace}/catalogItem/{catalog_item_id}/app' - f'/{app_name}/label/Live') + f'/{platform}/namespace/{namespace}/catalogItem/{catalog_item_id}/app' + f'/{app_name}/label/{label}') r.raise_for_status() return r.json()