Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code: 1004. The item or resource being requested could not be found. #22

Closed
MrPepino opened this issue Oct 5, 2023 · 3 comments
Closed

Comments

@MrPepino
Copy link

MrPepino commented Oct 5, 2023

Hello, I've started to receive this error since today:

Traceback (most recent call last):
  File "C:\Python\epicstore_free\main.py", line 200, in <module>
    main()
  File "C:\Python\epicstore_free\main.py", line 190, in main
    output = check_free_games()
  File "C:\Python\epicstore_free\main.py", line 29, in check_free_games
    free_games = api.get_free_games()['data']['Catalog']['searchStore']['elements']
  File "C:\Python\epicstore_free\.venv\lib\site-packages\epicstore_api\api.py", line 98, in get_free_games
    self._get_errors(data)
  File "C:\Python\epicstore_free\.venv\lib\site-packages\epicstore_api\api.py", line 483, in _get_errors
    raise EGSNotFound(
epicstore_api.exc.EGSNotFound: Error code: 1004. The item or resource being requested could not be found.
@TorCroft
Copy link

TorCroft commented Oct 7, 2023

You can directly return data in method EpicGamesStoreAPI.get_free_games. Simply skip self._get_errors(data).

def get_free_games(self, allow_countries: str = None) -> dict:
    """Returns the games from "Free Games" section in the EGS."""
    if allow_countries is None:
        allow_countries = self.country
    api_uri = (
        "https://store-site-backend-static.ak.epicgames.com/"
        "freeGamesPromotions?locale={}&country={}&allowCountries={}"
    )
    api_uri = api_uri.format(self.locale, self.country, allow_countries)
    data = self._session.get(api_uri).json()
    return data

I tested once, the game data returned is still normal, I don't know why there is an error The item or resource being requested could not be found..

@MrPepino
Copy link
Author

MrPepino commented Oct 8, 2023

I think the issue is that empty values in the JSON response are being presented as None values instead of null.

@SD4RK
Copy link
Owner

SD4RK commented Oct 8, 2023

^ Fixed with the latest commit. Looks like Epic Games messed something up like with the collections method, launcher is ignoring those errors so we probably shall too.

Closed.

@SD4RK SD4RK closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants