Skip to content

fix: set User-Agent for Wikipedia OpenSearch requests (#159)#160

Merged
PenguinBoi12 merged 1 commit into
Code-Society-Lab:mainfrom
SAY-5:fix/wikipedia-user-agent
May 11, 2026
Merged

fix: set User-Agent for Wikipedia OpenSearch requests (#159)#160
PenguinBoi12 merged 1 commit into
Code-Society-Lab:mainfrom
SAY-5:fix/wikipedia-user-agent

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 11, 2026

Closes #159.

Wikimedia blocks the default urllib User-Agent (`Python-urllib/x.y`) per the Wikimedia Foundation User-Agent Policy, so the `/wiki` command currently crashes with an HTTP 403.

This sets an explicit descriptive User-Agent identifying the bot and linking back to the repository, which satisfies the policy and restores OpenSearch results.

Closes Code-Society-Lab#159

The Wikimedia User-Agent Policy blocks the default urllib User-Agent
("Python-urllib/x.y"), causing the /wiki command to crash. Set an
explicit descriptive User-Agent identifying the bot and linking to
the repository, as required by Wikimedia.
Copy link
Copy Markdown
Contributor

@PenguinBoi12 PenguinBoi12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix.

@PenguinBoi12 PenguinBoi12 merged commit e956ac6 into Code-Society-Lab:main May 11, 2026
1 of 2 checks 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.

Wikipedia OpenSearch blocks default requests User Agent

2 participants