Skip to content

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

Merged
Naramsim merged 1 commit intomasterfrom
meta-scrape
Mar 13, 2026
Merged

fix: scrape endpoints that don't expose count property#52
Naramsim merged 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

@Naramsim
Copy link
Member Author

Seems fine from my local tests. I'm merging

@Naramsim Naramsim merged commit 502ac46 into master Mar 13, 2026
1 check passed
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