derrod/legendary

Failed to execute script 'cli' due to unhandled exception!

0wn3dg0d opened this issue · 2 comments

Platform

Operating system and version: Windows 11, 22H2
Legendary version: "0.20.33", codename "Undue Alarm"

Expected Behavior

When using the command legendary list --third-party I should get a list of games that also includes apps that are not installable

Current Behavior and steps to Reproduce

The legendary list command works without problems
But when I use the command legendary list --third-party, I get:

[cli] INFO: Logging in...
[Core] INFO: Trying to re-use existing login session...
[cli] INFO: Getting game list... (this may take a while)
Traceback (most recent call last):
  File "legendary\cli.py", line 3148, in <module>
  File "legendary\cli.py", line 3059, in main
  File "legendary\cli.py", line 206, in list_games
  File "legendary\core.py", line 531, in get_non_asset_library_items
  File "legendary\api\egs.py", line 201, in get_game_info
  File "requests\models.py", line 1021, in raise_for_status
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://catalog-public-service-prod06.ol.epicgames.com/catalog/api/shared/namespace/p-dlmgtzntcfrfg6cmfwuxqmpaeuk49q/bulk/items?id=6aa934dbfaea49bdb50f74ab286983a5&includeDLCDetails=True&includeMainGameDetails=True&country=RU&locale=ru
[19872] Failed to execute script 'cli' due to unhandled exception!

Additional information

Receiving information about some “uninstallable” game leads to a request that is blocked, resulting in an error.
I suppose you might consider adding some kind of exception handling to the code so that blocking a request due to some problematic game doesn't result in the command being unable to be used (if possible).
Honestly, I don’t know how to bypass this problem.

Fix, for example (skip Private apps, like this one for @0wn3dg0d ):
/legendary/core.py

        for libitem in self.egs.get_library_items():
            if libitem['namespace'] == 'ue' and skip_ue:
                continue
            if libitem['appName'] in ignore:
                continue
            if libitem['sandboxType'] == 'PRIVATE':
                continue

            game = self.lgd.get_game_meta(libitem['appName'])

Fix, for example

Nice solution.

I wonder if it's possible to add a command that will allow you to add ignored namespaces, like
addignoredns
(and ignored namespaces will be stored in the config).

To be able to use this with the prebuilt standalone binary.

@derrod Do you think this is possible?
Or perhaps there's a possible way to to automatically ignore problematic namespaces?