This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Description
Trying to source logos for example from wikipedia can run into:
requests.exceptions.HTTPError: 403 Client Error: Forbidden. Please comply with the User-Agent policy: https://meta.wikimedia.org/wiki/User-Agent_policy
Which states that there must be user-agent information or scripts may be blocked without notice. The expected format is
<client name>/<version> (<contact information>) <library/framework name>/<version> [<library name>/<version> ...]
They provide a template for python:
import requests
url = 'https://example/...'
headers = {'User-Agent': 'CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org)'}
response = requests.get(url, headers=headers)
Suggestions:
- Add standard header like
{'User-Agent': 'pybadges/3.0.0 (https://github.com/google/pybadges/)}
- And/Or add
--user-agent option to allow passing this information manually.