Skip to content

Commit

Permalink
fix: migrate library fetching to AnimusEntitlementsService
Browse files Browse the repository at this point in the history
  • Loading branch information
imLinguin committed Sep 5, 2024
1 parent 9ce614f commit aefa5dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions nile/api/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ def request_distribution(self, target, token, body):
"Content-Type": "application/json",
"Content-Encoding": "amz-1.0",
}
url = (constants.AMAZON_GAMING_DISTRIBUTION_ENTITLEMENTS
if target.endswith(".GetEntitlements")
else constants.AMAZON_GAMING_DISTRIBUTION)
response = self.session_manager.session.post(
constants.AMAZON_GAMING_DISTRIBUTION,
url,
headers=headers,
json=body,
)
Expand All @@ -50,7 +53,7 @@ def request_distribution(self, target, token, body):

def _get_sync_request_data(self, serial, next_token=None, sync_point=None):
request_data = {
"Operation": "GetEntitlementsV2",
"Operation": "GetEntitlements",
"clientId": "Sonic",
"syncPoint": sync_point,
"nextToken": next_token,
Expand Down Expand Up @@ -101,8 +104,8 @@ def sync(self):
while True:
request_data = self._get_sync_request_data(serial, next_token, sync_point)

response = self.request_sds(
"com.amazonaws.gearbox.softwaredistribution.service.model.SoftwareDistributionService.GetEntitlementsV2",
response = self.request_distribution(
"com.amazon.animusdistributionservice.entitlement.AnimusEntitlementsService.GetEntitlements",
token,
request_data,
)
Expand Down
1 change: 1 addition & 0 deletions nile/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
AMAZON_SDS = "https://sds.amazon.com"
AMAZON_GAMING_GRAPHQL = "https://gaming.amazon.com/graphql"
AMAZON_GAMING_DISTRIBUTION = "https://gaming.amazon.com/api/distribution/v2/public"
AMAZON_GAMING_DISTRIBUTION_ENTITLEMENTS = "https://gaming.amazon.com/api/distribution/entitlements"

FUZZY_SEARCH_RATIO = 0.7

Expand Down
2 changes: 1 addition & 1 deletion nile/utils/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def start(self, game_path):
scummvm_command = self.get_scummvm_command()
if instruction.command.lower().endswith("scummvm.exe") and len(scummvm_command) > 0:
self.logger.info(f"Using native scummvm {scummvm_command}")
command.extend(scummvm_command)
command = scummvm_command
command.extend(instruction.arguments)
else:
if not self.dont_use_wine and not self.bottle:
Expand Down

0 comments on commit aefa5dd

Please sign in to comment.