Skip to content

images_and_vernaculars: Pass non-banned useragent to wikimedia#118

Merged
lentinj merged 1 commit intomainfrom
images-via-requests
Nov 3, 2025
Merged

images_and_vernaculars: Pass non-banned useragent to wikimedia#118
lentinj merged 1 commit intomainfrom
images-via-requests

Conversation

@lentinj
Copy link
Collaborator

@lentinj lentinj commented Nov 3, 2025

#117 fixes the image-fetching in the unit tests (by removing it), but didn't actually fix the code.

This pull does similar to #115, converting the urllib.request.urlretrieve to requests.get with a custom UA.

Closes #115

We're not allowed to fetch images with urllib's default user-agent.
Instead, switch to using requests & fetch using our custom UA.

Remove the now-unused urllib mocks.

Fixes #115
@lentinj lentinj merged commit e385952 into main Nov 3, 2025
2 checks passed
@lentinj lentinj deleted the images-via-requests branch November 3, 2025 14:25
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