Skip to content

fix: scrape endpoints that don't expose count property#52

Open
Naramsim wants to merge 1 commit intomasterfrom
meta-scrape
Open

fix: scrape endpoints that don't expose count property#52
Naramsim wants to merge 1 commit intomasterfrom
meta-scrape

Conversation

@Naramsim
Copy link
Member

The new meta endpoint doesn't expose the classic structure, in particular the count property. This makes Ditto fail.

  File "/updater/api-data/.venv/lib/python3.11/site-packages/pokeapi_ditto/commands/clone.py", line 77, in clone_endpoint
    res_urls = self._crawl_resource_list(res_list_url)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/updater/api-data/.venv/lib/python3.11/site-packages/pokeapi_ditto/commands/clone.py", line 63, in _crawl_resource_list
    count = self._crawl(zero_url, save=False)["count"]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'count'

This PR tries to address the problem

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

Successfully merging this pull request may close these issues.

1 participant