Skip to content

feat(providers): add Wikimedia Commons provider - #17

Merged
gitadityakumar merged 3 commits into
mainfrom
feat/wikimedia-provider
Sep 2, 2026
Merged

gitadityakumar merged 3 commits into
mainfrom
feat/wikimedia-provider

Conversation

@gitadityakumar

Copy link
Copy Markdown
Owner

Description

Adds Wikimedia Commons as a supported asset provider in ast. Wikimedia Commons is the world's largest open educational and stock media repository hosting tens of millions of freely usable CC0, public domain, and Creative Commons images and media files.

Features

  • Search: Uses the official MediaWiki Action API (action=query&generator=search&gsrnamespace=6...) querying image/media items in namespace 6.
  • Relevance Ordering: Sorts search results by MediaWiki relevance rank (index).
  • Direct Master Full-Resolution Media Downloads: Extracts master media URLs (https://upload.wikimedia.org/wikipedia/commons/...) with query tracking stripped, downloading original full-resolution photo and vector assets.
  • Thumbnails & Dimensions: Fetches 500px thumbnail URLs and extracts native image width and height.
  • Metadata: Formats clean IDs as wikimedia-{pageid}, human-readable clean titles without File: and extension prefix, author attribution (Wikimedia Commons Contributors), and canonical page URLs.
  • Integration: Fully wired into registry, CLI search commands (ast s wikimedia ...), and interactive mode.

Verification

  • Tested search via ast s wikimedia "sunset" --limit 2 --json
  • Verified direct full-resolution download via ast s wikimedia "sunset" --first --download -o /tmp/downloads-test (downloaded 862 KB master photo JPEG @ 2789x1980)
  • Verified all unit and integration tests pass with zig build && zig build test.

@gitadityakumar
gitadityakumar merged commit cb380d4 into main Sep 2, 2026
1 check passed
@gitadityakumar
gitadityakumar deleted the feat/wikimedia-provider branch September 2, 2026 17:17
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